public object SaveMainBusinessExpInfo(MainBusinessExpInfo mainBusinessExpInfo)
 {
     mainBusinessExpInfo.Save();
     return mainBusinessExpInfo . MainBusinessExpId;
 }
Пример #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);
                }
            }
        }
 public object  SaveMainBusinessExpInfo(MainBusinessExpInfo mainBusinessExpInfo)
 {
     mainBusinessExpInfo.Save();
     return(mainBusinessExpInfo.MainBusinessExpId);
 }