protected void SheetNum() { DateTime date = DateTime.Now; string strtoday = DateTime.Now.ToString("yyyyMMdd").Substring(2); if (SheetNums.IsSheetNumOfSE(strtoday)) { txtSheetNum.Text = SheetNums.SheetNumOfSE("TF", strtoday); } else { txtSheetNum.Text = "TF" + strtoday + "001"; } }
protected void btnSave_Click(object sender, EventArgs e) { if (IsPageValid()) { try { int emid = Convert.ToInt32(Session["EmployeeId"]); EmployeeInfo em = (EmployeeInfo)Session["Employee"]; MainSpecialExpInfo main = new MainSpecialExpInfo(); main.Save(); SpecialExpInfo sp = new SpecialExpInfo(); sp.MainSpecialExpId = main.MainSpecialExpId; DateTime date = DateTime.Now; string strtoday = DateTime.Now.ToString("yyyyMMdd").Substring(2); sp.Today = strtoday; sp.SheetNum = txtSheetNum.Text.ToString(); sp.ApplyDate = Convert.ToDateTime(txtApplyDate.Text.ToString()); sp.ApplyPeople = lblApplyPeople.Text.ToString(); sp.ApplyReason = txtReason.Text.ToString(); sp.ApplyMoney = txtApplyMoney.Text.ToString(); if (ddlProject.SelectedValue != "") { sp.MainProjectCreateId = Convert.ToInt32(ddlProject.SelectedValue); } if (ddlProjectStep.SelectedValue.ToString() != "") { sp.ProjectStepId = Convert.ToInt32(ddlProjectStep.SelectedValue); } string strRoleName = Session["RoleName"].ToString(); if (strRoleName == "部门经理") { sp.SendEmployeeName = em.EmployeeName; sp.SendEmployeeId = emid; sp.PreIsApply = 1; sp.PreIsOver = 1; sp.SignName = 1; } else { sp.PreEmployeeId = em.EmployeeId; sp.PreEmployeeName = em.EmployeeName; sp.PreIsApply = 0; sp.PreIsOver = 0; sp.SignName = 0; } sp.IsApply = 0; sp.IsApprove = 0; sp.IsApply1 = 0; sp.IsApply2 = 0; sp.IsOver1 = 0; sp.IsOver2 = 0; //GridView嵌套判断 sp.IsMain = 1; sp.IsMain1 = 1; sp.IsMain2 = 1; sp.IsMain3 = 1; sp.IsNewCreate = 0; sp.Save(); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('添加成功!');</script>"); txtSheetNum.Text = SheetNums.SheetNumOfSE("TSFY", strtoday); } catch (Exception Ex) { ClientScript.RegisterStartupScript(this.GetType(), "Save", "alert('添加失败:" + Ex.Message + "');", true); } } }