MY_ZZCG_XG.aspx (只读查看)

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MY_ZZCG_XG.aspx.cs" Inherits="GSAO.CGGL.MY_ZZCG_XG" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>成果管理_修改专利成果</title>
     <link href="../css/style.css" rel="stylesheet" type="text/css" />
     <script language="javascript" type="text/javascript" src="../My97DatePicker/WdatePicker.js"></script>
</head>
<body>
    <form id="form1" runat="server">
    <table class="tbDefault mt5 mb5" width="900">
        <caption>成果管理_修改专利成果</caption>
       
        <tr>
            <td class="tdRight bgEFEFEF" width="100">成果类型:</td>
            <td class="tdLeft">
                <asp:DropDownList ID="ddl_CGGL_ZZCG_LX" runat="server" CssClass="ddl">
                    <asp:ListItem Value="主编">主编</asp:ListItem>
                    <asp:ListItem Value="副主编">副主编</asp:ListItem>
                    <asp:ListItem Value="独著">独著</asp:ListItem>
                </asp:DropDownList>
            </td>
            <td class="tdRight bgEFEFEF" width="100"><font color='red'>*</font>名称:</td>
            <td class="tdLeft">
                <asp:TextBox ID="tb_CGGL_ZZCG_MC" runat="server" CssClass="txt" Width="100%"></asp:TextBox>
            </td>
           
        </tr>
       <tr>
            <td class="tdRight bgEFEFEF" width="100">出版社:</td>
            <td class="tdLeft" width="280">
                <asp:TextBox ID="tb_CGGL_ZZCG_CBS" runat="server" CssClass="txt"></asp:TextBox>
            </td>
            <td class="tdRight bgEFEFEF" width="100">书 号:</td>
            <td class="tdLeft" width="280">
                <asp:TextBox ID="tb_CGGL_ZZCG_SH" runat="server" CssClass="txt"></asp:TextBox>
            </td>
        </tr>
        
         <tr>
            <td class="tdRight bgEFEFEF" width="100">个人排名:</td>
            <td class="tdLeft" width="280">
                <asp:TextBox ID="tb_CGGL_ZZCG_GRPM" runat="server" CssClass="txt"></asp:TextBox>
            </td>
            <td class="tdRight bgEFEFEF" width="100">工作量:</td>
            <td class="tdLeft" width="280">
                <asp:TextBox ID="tb_CGGL_ZZCG_GZL" runat="server" CssClass="txt"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="tdRight bgEFEFEF" width="100">作 者:</td>
            <td class="tdLeft" width="280">
                <asp:TextBox ID="tb_CGGL_ZZCG_ZZ" runat="server" CssClass="txt"></asp:TextBox>
            </td>
            <td class="tdRight bgEFEFEF" width="100">出版日期:</td>
            <td class="tdLeft" width="280">
                 <INPUT class="txt" id="tb_CGGL_ZZCG_CBRQ" runat="server" onfocus="WdatePicker()" >
            </td>
        </tr>
         <tr>
            <td class="tdRight bgEFEFEF" width="100" >备注:</td>
            <td class="tdLeft"   colspan="3">
                <asp:TextBox ID="tb_CGGL_ZZCG_BZ" runat="server" CssClass="textarea f12"  Width="700" Height="50"  TextMode="MultiLine"></asp:TextBox>
            </td>
        </tr>
        
        <tr>
            <td class="tdRight bgEFEFEF" width="100">学 院:</td>
            <td class="tdLeft" width="280">
                 <asp:Label ID="lb_CGGL_YXSM" runat="server" Text="" Visible="false"></asp:Label>
                <asp:Label ID="lb_CGGL_YXSM_MC" runat="server" Text="" CssClass="lbl"></asp:Label>
            </td>
            <td class="tdRight bgEFEFEF" width="100">年 级:</td>
            <td class="tdLeft" width="280">
             <asp:Label ID="lb_CGGL_NJ" runat="server" Text="" CssClass="lbl"></asp:Label>
             
            </td>
        </tr>
        
         <tr>  
            <td class="tdRight bgEFEFEF" width="100">学 号:</td>
            <td class="tdLeft" width="280">
                <asp:Label ID="lb_CGGL_VID" runat="server" Text="0" Visible="false"></asp:Label>
                <asp:Label ID="lb_CGGL_XH" runat="server" Text="" CssClass="lbl"></asp:Label>
            </td>  
            <td class="tdRight bgEFEFEF" width="100">姓 名:</td>
            <td class="tdLeft" width="280">
                <asp:Label ID="lb_CGGL_XM" runat="server" Text="" CssClass="lbl"></asp:Label>
            </td>
        </tr>   
        
        <tr>  
            <td class="tdRight bgEFEFEF" width="100">专业:</td>
            <td class="tdLeft" width="280">
               <asp:Label ID="lb_CGGL_ZY_NAME" runat="server" Text="" CssClass="lbl"></asp:Label>
            </td>  
            <td class="tdRight bgEFEFEF" width="100">帐号:</td>
            <td class="tdLeft" width="280">
                <asp:Label ID="lb_CGGL_LDAP" runat="server" Text="" CssClass="lbl"></asp:Label>
            </td>
        </tr>  
         <tr>
            <td class="tdRight bgEFEFEF" width="100" >当前状态:</td>
            <td class="tdLeft"   colspan="3">
               <asp:Label ID="lb_ZT_FLG" runat="server" Text="" CssClass="lbl"></asp:Label>
            </td>
          
        </tr>
         <tr>
            <td class="tdRight bgEFEFEF" width="100" >审批意见:</td>
            <td class="tdLeft"   colspan="3">
                 <asp:Label ID="lb_CGGL_ZZCG_SPBZ" runat="server" Text="" CssClass="lbl"></asp:Label>
            </td>
          
        </tr> 
         <tr>
            <td colspan="4" class="fb">相关文件</td>
        </tr> 
         <tr>
            <td colspan="4" class="fb" align="center">
             <asp:GridView ID="GridView1" runat="server" CssClass="tbGvw" Width="500"  
          AutoGenerateColumns="false"     BorderStyle="Solid"  BorderWidth="1" 
           BorderColor="Silver"      
           onrowdatabound="GridView1_RowDataBound" 
         
           onrowcommand="GridView1_RowCommand">
          
        <HeaderStyle CssClass="tbHeader" />
        <RowStyle HorizontalAlign="Center" Wrap="False" Height="25px" ></RowStyle>
        <Columns>
         <asp:BoundField DataField="CGGL_WJ_KEY" HeaderText="ID不显示" />
         <asp:BoundField DataField="CGGL_WJ_LX" HeaderText="不显示" />          
            <asp:TemplateField HeaderText="删除" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Center" >
            <ItemTemplate>
                <asp:ImageButton id="btn_delete" CommandArgument ="<%#  GridView1.Rows.Count %>" CommandName="delete1" runat="server" ImageUrl="../images/icon_delete.gif" ImageAlign="Baseline" AlternateText="删除"></asp:ImageButton>             
            </ItemTemplate>
            </asp:TemplateField>  
            <asp:BoundField HeaderText="附件名称"  ItemStyle-Width="300px" ItemStyle-HorizontalAlign="Center" DataField="CGGL_WJ_MC"/>
            <asp:BoundField HeaderText="打开"  ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Center" DataField="CGGL_WJ_URL"/>
           
            </Columns>
          
      </asp:GridView>
            
            </td>
        </tr> 
        
         <tr id="tr_file" runat="server">  
            <td class="tdRight bgEFEFEF" width="100"><font color='red'>*</font>附件名称:</td>
            <td class="tdLeft" width="280">
            
                <asp:TextBox ID="tb_CGGL_WJ_MC" runat="server" CssClass="txt"></asp:TextBox>
            
            </td>  
            <td class="tdRight bgEFEFEF" width="100">上传:</td>
            <td class="tdLeft" width="280">
              <input id="inputFile" runat="server"  name="File1"  size="20" type="file"  /> 
               <asp:Button ID="btn_upload" runat="server" Text="上传" CssClass="btnStyle mr10" onclick="btn_upload_Click" 
                    />
            </td>
        </tr>   
        
       
        <tr>
            <td colspan="4">
                <asp:Button ID="btn_save" runat="server" Text="保存" CssClass="btnStyle mr10" 
                    onclick="btn_save_Click" />
               
                <input id="btn_back" type="button" value="返回" class="btnStyle" onclick="javascript:history.back();" /></td>
        </tr>
      </table>
    </form>
</body>
</html>
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace GSAO.CGGL
{
    public partial class MY_ZZCG_XG : System.Web.UI.Page
    {
        protected string CGGL_WJ_GLB = "ZZCG";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                Init_Data();
                Bind_gv();
                try
                {
                    if (this.Request.QueryString["showonly"].ToString() == "true")
                    {
                        Readonly_All();
                    }
                }
                catch
                { }
            }
        }

        protected void Readonly_All()
        {
            ddl_CGGL_ZZCG_LX.Enabled = false;
            tb_CGGL_ZZCG_MC.Enabled = false;
            tb_CGGL_ZZCG_CBS.Enabled = false;
            tb_CGGL_ZZCG_SH.Enabled = false;
            tb_CGGL_ZZCG_GRPM.Enabled = false;
            tb_CGGL_ZZCG_GZL.Enabled = false;
            tb_CGGL_ZZCG_ZZ.Enabled = false;
            tb_CGGL_ZZCG_CBRQ.Attributes.Add("onfocus", "");
            tb_CGGL_ZZCG_BZ.Enabled = false;
          
            this.GridView1.Columns[2].Visible = false;
            this.btn_save.Visible = false;
            this.tr_file.Visible = false;
           
        }
        protected void Init_Data()
        {
            string CGGL_ZZCG_KEY = this.Request.QueryString["CGGL_ZZCG_KEY"].ToString();
            DAL_GSAO_KYGL.Controller.CGGL_ZZCG C_CGGL_ZZCG = new DAL_GSAO_KYGL.Controller.CGGL_ZZCG();
            DAL_GSAO_KYGL.Entities.CGGL_ZZCG E_CGGL_ZZCG = C_CGGL_ZZCG.GetModel(int.Parse(CGGL_ZZCG_KEY));

            ddl_CGGL_ZZCG_LX.SelectedValue = E_CGGL_ZZCG.CGGL_ZZCG_LX;
            tb_CGGL_ZZCG_MC.Text = E_CGGL_ZZCG.CGGL_ZZCG_MC;
            tb_CGGL_ZZCG_CBS.Text = E_CGGL_ZZCG.CGGL_ZZCG_CBS;
            tb_CGGL_ZZCG_SH.Text = E_CGGL_ZZCG.CGGL_ZZCG_SH;
            tb_CGGL_ZZCG_GRPM.Text = E_CGGL_ZZCG.CGGL_ZZCG_GRPM;
            tb_CGGL_ZZCG_GZL.Text = E_CGGL_ZZCG.CGGL_ZZCG_GZL;
            tb_CGGL_ZZCG_ZZ.Text = E_CGGL_ZZCG.CGGL_ZZCG_ZZ;
            tb_CGGL_ZZCG_CBRQ.Value = E_CGGL_ZZCG.CGGL_ZZCG_CBRQ.ToShortDateString();
            tb_CGGL_ZZCG_BZ.Text = E_CGGL_ZZCG.CGGL_ZZCG_BZ;

            this.lb_CGGL_XH.Text = E_CGGL_ZZCG.CGGL_XH;
            this.lb_CGGL_XM.Text = E_CGGL_ZZCG.CGGL_XM;
            this.lb_CGGL_VID.Text = E_CGGL_ZZCG.CGGL_VID.ToString();
            this.lb_CGGL_ZY_NAME.Text = E_CGGL_ZZCG.CGGL_ZY_NAME;
            this.lb_CGGL_NJ.Text = E_CGGL_ZZCG.CGGL_NJ;
            this.lb_CGGL_LDAP.Text = E_CGGL_ZZCG.CGGL_LDAP;
            this.lb_CGGL_YXSM.Text = E_CGGL_ZZCG.CGGL_YXSM.ToString();
            this.lb_CGGL_YXSM_MC.Text = E_CGGL_ZZCG.CGGL_YXSM_MC;


            this.lb_CGGL_ZZCG_SPBZ.Text = E_CGGL_ZZCG.CGGL_ZZCG_SPBZ;
            if (E_CGGL_ZZCG.ZT_FLG == 1)
                this.lb_ZT_FLG.Text = "已提交审批";
            if (E_CGGL_ZZCG.ZT_FLG == 2)
                this.lb_ZT_FLG.Text = "学院审批通过";
            if (E_CGGL_ZZCG.ZT_FLG == 3)
                this.lb_ZT_FLG.Text = "学院审批不通过";
            if (E_CGGL_ZZCG.ZT_FLG == 4)
                this.lb_ZT_FLG.Text = "学校审批通过";
            if (E_CGGL_ZZCG.ZT_FLG == 5)
                this.lb_ZT_FLG.Text = "学校审批不通过";
        }
        protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                e.Row.Attributes.Add("onmouseover", "if(this.style.backgroundColor!='#ffffd0'){this.oldcolor=this.style.backgroundColor;this.style.backgroundColor='#c4e4ff';}");
                e.Row.Attributes.Add("onmouseout", "if(this.style.backgroundColor!='#ffffd0')this.style.backgroundColor=this.oldcolor;");
                e.Row.Attributes.Add("onmousedown", "if(this.style.backgroundColor=='#ffffd0')this.style.backgroundColor='white';else this.style.backgroundColor='#ffffd0';");
            }
            if ((e.Row.RowType == DataControlRowType.DataRow) || (e.Row.RowType == DataControlRowType.Header) || (e.Row.RowType == DataControlRowType.Footer))
            {
                e.Row.Cells[0].Visible = false;
                e.Row.Cells[1].Visible = false;
            }

        }
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "delete1")
            {
                int nIdx = Convert.ToInt32(e.CommandArgument.ToString());
                GridViewRow row = this.GridView1.Rows[nIdx];
                string id = row.Cells[0].Text;
                DAL_GSAO_KYGL.Controller.CGGL_WJ C_CGGL_WJ = new DAL_GSAO_KYGL.Controller.CGGL_WJ();
                C_CGGL_WJ.Delete(int.Parse(id));
                Bind_gv();
            }
        }
        private void Bind_gv()
        {
            string CGGL_ZZCG_KEY = this.Request.QueryString["CGGL_ZZCG_KEY"].ToString();
            string where = " CGGL_WJ_GLB='" + CGGL_WJ_GLB + "' and CGGL_GLB_KEY=" + CGGL_ZZCG_KEY;

            DAL_GSAO_KYGL.Controller.CGGL_WJ C_CGGL_WJ = new DAL_GSAO_KYGL.Controller.CGGL_WJ();
            DataSet ds = C_CGGL_WJ.GetList(where);
            this.GridView1.DataSource = ds.Tables[0];
            this.GridView1.DataBind();
            for (int i = 0; i < this.GridView1.Rows.Count; i++)
            {
                string url = this.GridView1.Rows[i].Cells[4].Text;
                this.GridView1.Rows[i].Cells[4].Text = "<a href=\"javascript:void(window.open('../CGGL_WJ/" + url + "'));\">打开</a>";
                System.Web.UI.WebControls.ImageButton btn_delete = (System.Web.UI.WebControls.ImageButton)this.GridView1.Rows[i].FindControl("btn_delete");
                btn_delete.Attributes.Add("onclick", "return confirm('确定要删除-" + this.GridView1.Rows[i].Cells[3].Text.Trim() + "-吗?');");
            }
        }
        private void SaveFile(out string strFileName, string strUploadDir)
        {
            strFileName = "";
            string strMsg = "";
            strUploadDir = "../" + strUploadDir + "/";
            Common_GSAO.Tools.FileSave(this, this.inputFile, strUploadDir, out strFileName, out strMsg);
        }
        protected void btn_save_Click(object sender, EventArgs e)
        {
            string from = "MY_ZZCG.aspx";
            try
            {
                from = this.Request.QueryString["from"].ToString();
            }
            catch
            { }
            if (this.tb_CGGL_ZZCG_MC.Text == "")
            {
                Common_GSAO.Tools.ShowAlert("-*-不能为空!");
                return;
            }
            string CGGL_ZZCG_KEY = this.Request.QueryString["CGGL_ZZCG_KEY"].ToString();
            DAL_GSAO_KYGL.Controller.CGGL_ZZCG C_CGGL_ZZCG = new DAL_GSAO_KYGL.Controller.CGGL_ZZCG();
            DAL_GSAO_KYGL.Entities.CGGL_ZZCG E_CGGL_ZZCG = C_CGGL_ZZCG.GetModel(int.Parse(CGGL_ZZCG_KEY));
            E_CGGL_ZZCG.CGGL_XH = this.lb_CGGL_XH.Text;
            E_CGGL_ZZCG.CGGL_XM = this.lb_CGGL_XM.Text;
            E_CGGL_ZZCG.CGGL_VID = int.Parse(this.lb_CGGL_VID.Text);
            E_CGGL_ZZCG.CGGL_ZY_NAME = this.lb_CGGL_ZY_NAME.Text;
            E_CGGL_ZZCG.CGGL_NJ = this.lb_CGGL_NJ.Text;
            E_CGGL_ZZCG.CGGL_LDAP = this.lb_CGGL_LDAP.Text;
            E_CGGL_ZZCG.CGGL_YXSM = int.Parse(this.lb_CGGL_YXSM.Text);
            E_CGGL_ZZCG.CGGL_YXSM_MC = this.lb_CGGL_YXSM_MC.Text;

            E_CGGL_ZZCG.CGGL_ZZCG_LX = ddl_CGGL_ZZCG_LX.SelectedValue;
            E_CGGL_ZZCG.CGGL_ZZCG_MC = tb_CGGL_ZZCG_MC.Text;
            E_CGGL_ZZCG.CGGL_ZZCG_CBS = tb_CGGL_ZZCG_CBS.Text;
            E_CGGL_ZZCG.CGGL_ZZCG_SH = tb_CGGL_ZZCG_SH.Text;
            E_CGGL_ZZCG.CGGL_ZZCG_GRPM = tb_CGGL_ZZCG_GRPM.Text;
            E_CGGL_ZZCG.CGGL_ZZCG_GZL = tb_CGGL_ZZCG_GZL.Text;
            E_CGGL_ZZCG.CGGL_ZZCG_ZZ = tb_CGGL_ZZCG_ZZ.Text;
            try
            {
                E_CGGL_ZZCG.CGGL_ZZCG_CBRQ = DateTime.Parse(tb_CGGL_ZZCG_CBRQ.Value);
            }
            catch
            {
                E_CGGL_ZZCG.CGGL_ZZCG_CBRQ = DateTime.Parse("1900-1-1");
            }
            E_CGGL_ZZCG.CGGL_ZZCG_BZ = tb_CGGL_ZZCG_BZ.Text;

            E_CGGL_ZZCG.CGGL_ZZCG_SPBZ = "";
            E_CGGL_ZZCG.CGGL_ZZCG_SYSTEM = "";
            E_CGGL_ZZCG.CGGL_ZZCG_SYSTEM_ID = 0;

            //审核状态
            if (from == "MY_DEPART_ZZCG.aspx")
                E_CGGL_ZZCG.ZT_FLG = 2;
            else if (from == "All_ZZCG.aspx")
                E_CGGL_ZZCG.ZT_FLG = 3;
            else
                E_CGGL_ZZCG.ZT_FLG = 1;

            C_CGGL_ZZCG.Update(E_CGGL_ZZCG);
            Common_GSAO.Tools.ShowAlertAndRedirect("成功保存-" + this.tb_CGGL_ZZCG_MC.Text + "-!", from);
        }

        protected void btn_upload_Click(object sender, EventArgs e)
        {
            string strFileName = "";
            SaveFile(out strFileName, "CGGL_WJ");
            string CGGL_ZZCG_KEY = this.Request.QueryString["CGGL_ZZCG_KEY"].ToString();
            DAL_GSAO_KYGL.Controller.CGGL_WJ C_CGGL_WJ = new DAL_GSAO_KYGL.Controller.CGGL_WJ();
            DAL_GSAO_KYGL.Entities.CGGL_WJ E_CGGL_WJ = new DAL_GSAO_KYGL.Entities.CGGL_WJ();
            E_CGGL_WJ.CGGL_WJ_BZ = "";
            E_CGGL_WJ.CGGL_WJ_GLB = this.CGGL_WJ_GLB;
            E_CGGL_WJ.CGGL_GLB_KEY = int.Parse(CGGL_ZZCG_KEY);
            E_CGGL_WJ.CGGL_WJ_LX = "file";
            E_CGGL_WJ.CGGL_WJ_MC = this.tb_CGGL_WJ_MC.Text;
            E_CGGL_WJ.CGGL_WJ_URL = strFileName;
            C_CGGL_WJ.Add(E_CGGL_WJ);
            Bind_gv();
        }
    }
}

 

posted @ 2014-06-09 15:48  linyongqin  阅读(213)  评论(0编辑  收藏  举报