Exemplo n.º 1
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     if (IsPageValid())
     {
         try
         {
             int      id = Convert.ToInt32(Request["ToolApplyId"].ToString());
             ToolInfo t  = new ToolInfo(id);
             t.ManagerView = txtManagerView.Text.ToString();
             if (rblOver.Items[0].Selected)
             {
                 t.State = 5;
                 t.Save();
                 Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('您让申请人修正!');</script>");
             }
             else if (rblOver.Items[1].Selected)
             {
                 t.State = 4;
                 t.Save();
                 Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('审批通过!');</script>");
             }
         }
         catch (Exception Ex)
         {
             ClientScript.RegisterStartupScript(this.GetType(), "Save", "alert('保存失败:" + Ex.Message + "');", true);
         }
     }
 }
Exemplo n.º 2
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            int      id = Convert.ToInt32(((Button)sender).CommandArgument.ToString());
            ToolInfo wt = new ToolInfo(id);

            wt.State     = 1;
            wt.ApplyTime = DateTime.Now.ToString("yyyy-MM-dd");
            wt.Save();
            gvDataBind();
        }
Exemplo n.º 3
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            try
            {
                ToolNumInfo toolnum = new ToolNumInfo();
                toolnum.Num1  = txt1.Text.ToString();
                toolnum.Num2  = txt2.Text.ToString();
                toolnum.Num3  = txt3.Text.ToString();
                toolnum.Num4  = txt4.Text.ToString();
                toolnum.Num5  = txt5.Text.ToString();
                toolnum.Num6  = txt6.Text.ToString();
                toolnum.Num7  = txt7.Text.ToString();
                toolnum.Num8  = txt8.Text.ToString();
                toolnum.Num9  = txt9.Text.ToString();
                toolnum.Num10 = txt10.Text.ToString();
                toolnum.Num11 = txt11.Text.ToString();
                toolnum.Num12 = txt12.Text.ToString();
                toolnum.Num13 = txt13.Text.ToString();
                toolnum.Num14 = txt14.Text.ToString();
                toolnum.Num15 = txt15.Text.ToString();
                toolnum.Num16 = txt16.Text.ToString();
                toolnum.Num17 = txt17.Text.ToString();
                toolnum.Num18 = txt18.Text.ToString();
                toolnum.Num19 = txt19.Text.ToString();
                toolnum.Num20 = txt20.Text.ToString();
                toolnum.Num21 = txt21.Text.ToString();
                toolnum.Num22 = txt22.Text.ToString();
                toolnum.Num23 = txt23.Text.ToString();
                toolnum.Num24 = txt24.Text.ToString();
                toolnum.Num25 = txt25.Text.ToString();
                toolnum.Num26 = txt26.Text.ToString();
                toolnum.Num27 = txt27.Text.ToString();
                toolnum.Num28 = txt28.Text.ToString();
                toolnum.Num29 = txt29.Text.ToString();
                toolnum.Num30 = txt30.Text.ToString();
                toolnum.Num31 = txt31.Text.ToString();
                toolnum.Num32 = txt32.Text.ToString();
                toolnum.Num33 = txt33.Text.ToString();
                toolnum.Num34 = txt34.Text.ToString();
                toolnum.Num35 = txt35.Text.ToString();
                toolnum.Num36 = txt36.Text.ToString();
                toolnum.Num37 = txt37.Text.ToString();
                toolnum.Num38 = txt38.Text.ToString();
                toolnum.Num39 = txt39.Text.ToString();
                toolnum.Num40 = txt40.Text.ToString();
                toolnum.Save();

                ToolInfo tool = new ToolInfo();
                tool.ToolNumId  = toolnum.ToolNumId;
                tool.MarketMemo = txtMarketMemo.Text.ToString();
                tool.TechMemo   = txtTechMemo.Text.ToString();
                tool.ZongHeMemo = txtHrMemo.Text.ToString();
                tool.DepartView = txtDepartView.Text.ToString();
                tool.ApplyName  = Session["EmployeeName"].ToString();
                tool.State      = 0;
                tool.DepartName = Session["DepartName"].ToString();
                tool.Save();
                Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('Ìí¼Ó³É¹¦£¡');</script>");
            }
            catch (Exception Ex)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "Save", "alert('±£´æʧ°Ü£º" + Ex.Message + "');", true);
            }
        }