Beispiel #1
0
        protected void SheetNum()
        {
            DateTime date     = DateTime.Now;
            string   today    = DateTime.Now.ToString("yyyyMMdd");
            string   strtoday = today.Substring(2);

            if (SheetNums.IsSheetNumOfBE(strtoday))
            {
                txtSheetNum.Text = SheetNums.SheetNumOfBE("ZF", strtoday);
            }
            else
            {
                txtSheetNum.Text = "ZF" + strtoday + "001";
            }
        }
Beispiel #2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (IsPageValid())
            {
                try
                {
                    EmployeeInfo em   = (EmployeeInfo)Session["Employee"];
                    int          emid = Convert.ToInt32(Session["EmployeeId"]);

                    MainBusinessExpInfo main = new MainBusinessExpInfo();
                    main.Save();

                    int             bExpId = Convert.ToInt32(Request["BusinessExpId"].ToString());
                    BusinessExpInfo be     = new BusinessExpInfo(bExpId);
                    be.MainBusinessExpId = main.MainBusinessExpId;

                    DateTime date     = DateTime.Now;
                    string   strtoday = DateTime.Now.ToString("yyyyMMdd").Substring(2);
                    be.Today    = strtoday;
                    be.SheetNum = txtSheetNum.Text.ToString();

                    be.ApplyDate   = Convert.ToDateTime(txtApplyDate.Text.ToString());
                    be.ApplyPeople = lblApplyPeople.Text.ToString();
                    be.Depart      = lblDepart.Text.ToString();
                    be.Memo        = txtMemo.Text.ToString();
                    be.ReasonExp   = txtReason.Text.ToString();

                    be.Item1    = txtItem1.Text.ToString();
                    be.Item2    = txtItem2.Text.ToString();
                    be.Item3    = txtItem3.Text.ToString();
                    be.Item4    = txtItem4.Text.ToString();
                    be.Money1   = txtMoney1.Text.ToString();
                    be.Money2   = txtMoney2.Text.ToString();
                    be.Money3   = txtMoney3.Text.ToString();
                    be.Money4   = txtMoney4.Text.ToString();
                    be.MoneySum = txtMoneySum.Text.ToString();

                    string strRoleName = Session["RoleName"].ToString();
                    if (strRoleName == "部门经理")
                    {
                        be.SendEmployeeName = em.EmployeeName;
                        be.SendEmployeeId   = emid;
                        be.PreIsApply       = 1;
                        be.PreIsOver        = 1;
                        be.SignName         = 1;
                    }
                    else
                    {
                        be.PreEmployeeId   = em.EmployeeId;
                        be.PreEmployeeName = em.EmployeeName;
                        be.PreIsApply      = 0;
                        be.PreIsOver       = 0;
                        be.SignName        = 0;
                    }
                    be.IsApply   = 0;
                    be.IsApprove = 0;
                    be.IsApply1  = 0;
                    be.IsApply2  = 0;
                    be.IsOver1   = 0;
                    be.IsOver2   = 0;

                    //GridView嵌套判断
                    be.IsMain      = 1;
                    be.IsMain1     = 1;
                    be.IsMain2     = 1;
                    be.IsMain3     = 1;
                    be.IsNewCreate = 0;
                    be.Save();

                    Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('添加成功!');</script>");
                    //ClearForms();
                    ViewState["Isbtn"] = "1";
                    txtSheetNum.Text   = SheetNums.SheetNumOfBE("ZDFY", strtoday);
                }
                catch (Exception Ex)
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "Save", "alert('添加失败:" + Ex.Message + "');", true);
                }
            }
        }