protected void btnAddSheet_Click(object sender, EventArgs e) { OfferPriceInfo op = new OfferPriceInfo(); op.Save(); int opid = Convert.ToInt32(op.OfferPriceId); Response.Redirect("AddPrice.aspx?OfferPriceId=" + opid); }
protected void btnSave_Click(object sender, EventArgs e) { if (IsPageValid()) { try { int wkid = Convert.ToInt32(Request["OfferPriceId"].ToString()); OfferPriceInfo pc = new OfferPriceInfo(wkid); pc.SectionView = txtSectionView.Text.ToString(); pc.IsApprove = 1; DateTime date = DateTime.Now; pc.ApproveTime = date; pc.IsSignName = 1; if (rblOver.Items[0].Selected) { pc.PreIsOver = 0; pc.IsNewCreate = 1; pc.Save(); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('您让申请人修正!');</script>"); } else if (rblOver.Items[1].Selected) { pc.PreIsOver = 1; //int emid = Convert.ToInt32(Common.getEmployeeIdOfFinaceManager());//财务部经理接收 //pc.Recv1EmployeeId = emid; int emid = Convert.ToInt32(Common.getEmployeeIdOfManager());//总经理接收 pc.Recv2EmployeeId = emid; pc.Save(); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('审批通过!');</script>"); } } catch (Exception Ex) { ClientScript.RegisterStartupScript(this.GetType(), "Save", "alert('保存失败:" + Ex.Message + "');", true); } } }
protected void btnSave_Click(object sender, EventArgs e) { if (IsPageValid()) { try { int opid = Convert.ToInt32(Request["OfferPriceId"].ToString()); OfferPriceInfo op = new OfferPriceInfo(opid); op.MangerView = txtManagerView.Text.ToString(); op.IsApply2 = 1; DateTime date = DateTime.Now; op.Apply2Time = date; op.IsSignName = 2; if (rblOver.Items[0].Selected) { op.IsOver2 = 0; op.IsNewCreate = 1; op.Save(); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('ÄúÈÃÉêÇëÈËÐÞÕý£¡');</script>"); MessageInfo.DelMessageOfMemo(opid.ToString()); } else if (rblOver.Items[1].Selected) { op.IsOver2 = 1; op.Save(); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('±£´æ³É¹¦£¡');</script>"); MessageInfo.DelMessageOfMemo(opid.ToString()); } } catch (Exception Ex) { ClientScript.RegisterStartupScript(this.GetType(), "Save", "alert('±£´æʧ°Ü£º" + Ex.Message + "');", true); } } }
protected void btnSave_Click(object sender, EventArgs e) { if (Page.IsValid) { try { int opid = Convert.ToInt32(Request["OfferPriceId"].ToString()); OfferPriceInfo op = new OfferPriceInfo(opid); op.IsApply1 = 1; DateTime date = DateTime.Now; op.Apply1Time = date; MessageInfo.DelMessageOfMemo(opid.ToString()); if (rblOver.Items[0].Selected) { op.IsOver1 = 0; op.IsNewCreate = 1; op.Save(); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('ÄúÈÃÉêÇëÈËÐÞÕý£¡');</script>"); } else if (rblOver.Items[1].Selected) { op.IsOver1 = 1; //int emid = Convert.ToInt32(Common.getEmployeeIdOfManager()); //op.Recv2EmployeeId = emid; op.Save(); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('ÉóÅúͨ¹ý£¡');</script>"); } Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('±£´æ³É¹¦£¡');</script>"); } catch (Exception Ex) { ClientScript.RegisterStartupScript(this.GetType(), "Save", "alert('±£´æʧ°Ü£º" + Ex.Message + "');", true); } } }
protected void btnSubmit_Click(object sender, EventArgs e) { int wksumId = Convert.ToInt32(((Button)sender).CommandArgument.ToString()); OfferPriceInfo wksum = new OfferPriceInfo(wksumId); if (wksum.PreIsApply == 0) { wksum.PreIsApply = 1; DateTime date = DateTime.Now; wksum.PreApplyTime = date; int recvemid = Convert.ToInt32(Common.getEmployeeIdOfMarketManager());//市场部经理接收项目立项表 wksum.RecvEmployeeId = recvemid; wksum.Save(); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('申请成功!');</script>"); gvDataBind(); } }
protected void btnSave_Click(object sender, EventArgs e) { if (IsPageValid()) { try { int opid = Convert.ToInt32(Request["OfferPriceId"].ToString()); OfferPriceInfo pc = new OfferPriceInfo(opid); if (pc.IsNewCreate == 1) { pc.IsMain = 0; pc.IsMain1 = 0; pc.IsMain2 = 0; pc.IsMain3 = 0; OfferPriceInfo pcnew = new OfferPriceInfo(); pcnew.IsMain = 1; pcnew.IsMain1 = 1; pcnew.IsMain2 = 1; pcnew.IsMain3 = 1; pcnew.IsNewCreate = 0; pcnew.MainOfferPriceId = pc.MainOfferPriceId; pcnew.SendEmployeeId = pc.SendEmployeeId; pcnew.SendEmployeeName = pc.SendEmployeeName; pcnew.PreIsApply = 1; pcnew.PreIsOver = 1; pcnew.IsApply = 0; pcnew.IsApprove = 0; pcnew.IsApply1 = 0; pcnew.IsApply2 = 0; pcnew.IsOver1 = 0; pcnew.IsOver2 = 0; pcnew.IsSignName = 0; if (ddlProject.SelectedValue != "") { pcnew.MainProjectCreateId = Convert.ToInt32(ddlProject.SelectedValue); } if (ddlEmployee.SelectedValue != "") { pcnew.EmployeeId = Convert.ToInt32(ddlEmployee.SelectedValue); } DateTime date = DateTime.Now; string strtoday = DateTime.Now.ToString("yyyyMMdd").Substring(2); pcnew.Today = strtoday; if (UpFile.HasFile == true) { string name = this.UpFile.FileName; int startindex = this.UpFile.FileName.LastIndexOf(@"\") + 1; string fileName = this.UpFile.FileName.Substring(startindex); string phyFileName = this.Server.MapPath(@"~\Files\" + "OfferPrice") + @"\" + fileName; this.UpFile.SaveAs(phyFileName); if (pcnew.OfferFileId.ToString() == "") { OfferFileInfo of = new OfferFileInfo(); of.OfferFileName = fileName; of.PhyFileName = UpFile.PostedFile.FileName;//获取本地文件路径 of.Save(); pcnew.OfferFileId = Convert.ToInt32(of.OfferFileId); } else { OfferFileInfo of = new OfferFileInfo(Convert.ToInt32(pcnew.OfferFileId)); of.OfferFileName = fileName; //文件名称 of.PhyFileName = UpFile.PostedFile.FileName; //获取本地文件路径 of.Save(); pcnew.OfferFileId = Convert.ToInt32(of.OfferFileId); } lblUrl.Text = UpFile.PostedFile.FileName;//本地文件路径 } if (UpFile.HasFile) { this.UpFile.PostedFile.SaveAs(Server.MapPath("~/Files/OfferPrice/" + UpFile.FileName)); } pcnew.OfferPriceTypeId = Convert.ToInt32(rblType.SelectedValue); pcnew.FillTableDate = Convert.ToDateTime(txtFillTableDate.Text.ToString()); pcnew.SectionView = txtSectionView.Text.ToString(); pcnew.SheetNum = txtSheetNum.Text.ToString(); pcnew.ProjectDes = txtProjectDes.Text.ToString(); pcnew.MoneySum = txtMoneySum.Text.ToString(); pcnew.BigMoney = txtBigMoney.Text.ToString(); pcnew.ProductMoneySum = lblMoneySum.Text.ToString(); pcnew.Save(); pc.Save(); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('修正成功!');</script>"); } else { if (ddlProject.SelectedValue != "") { pc.MainProjectCreateId = Convert.ToInt32(ddlProject.SelectedValue); } if (ddlEmployee.SelectedValue != "") { pc.EmployeeId = Convert.ToInt32(ddlEmployee.SelectedValue); } if (UpFile.HasFile == true) { string name = this.UpFile.FileName; int startindex = this.UpFile.FileName.LastIndexOf(@"\") + 1; string fileName = this.UpFile.FileName.Substring(startindex); string phyFileName = this.Server.MapPath(@"~\Files\" + "OfferPrice") + @"\" + fileName; this.UpFile.SaveAs(phyFileName); if (pc.OfferFileId.ToString() == "") { OfferFileInfo of = new OfferFileInfo(); of.OfferFileName = fileName; of.PhyFileName = UpFile.PostedFile.FileName;//本地文件路径 of.Save(); pc.OfferFileId = Convert.ToInt32(of.OfferFileId); } else { OfferFileInfo of = new OfferFileInfo(Convert.ToInt32(pc.OfferFileId)); of.OfferFileName = fileName; //文件名称 of.PhyFileName = UpFile.PostedFile.FileName; //本地文件路径 of.Save(); pc.OfferFileId = Convert.ToInt32(of.OfferFileId); } lblUrl.Text = UpFile.PostedFile.FileName; } if (UpFile.HasFile) { ////文件上传地址根目录,这里通过IIS架设本地主机为FTP服务器 //string FileSaveUri = @"ftp://192.168.11.70/www/Files/OfferPrice/"; ////FTP用户名密码,就是本机的用户名密码 //string ftpUser = "******"; //string ftpPassWord = "******"; //SendFiles(FileSaveUri, ftpUser, ftpPassWord); this.UpFile.PostedFile.SaveAs(Server.MapPath("~/Files/OfferPrice/" + UpFile.FileName)); } pc.FillTableDate = Convert.ToDateTime(txtFillTableDate.Text.ToString()); pc.SectionView = txtSectionView.Text.ToString(); pc.SheetNum = txtSheetNum.Text.ToString(); pc.ProjectDes = txtProjectDes.Text.ToString(); pc.OfferPriceTypeId = Convert.ToInt32(rblType.SelectedValue); pc.MoneySum = txtMoneySum.Text.ToString(); pc.BigMoney = txtBigMoney.Text.ToString(); pc.ProductMoneySum = lblMoneySum.Text.ToString(); pc.Save(); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('编辑成功!');</script>"); } } catch (Exception Ex) { ClientScript.RegisterStartupScript(this.GetType(), "Save", "alert('添加失败:" + Ex.Message + "');", true); } } }
protected void btnSave_Click(object sender, EventArgs e) { if (IsPageValid()) { try { EmployeeInfo em = (EmployeeInfo)Session["Employee"]; MainOfferPriceInfo mainop = new MainOfferPriceInfo(); mainop.Save(); int OpId = Convert.ToInt32(Request["OfferPriceId"].ToString()); OfferPriceInfo op = new OfferPriceInfo(OpId); op.MainOfferPriceId = mainop.MainOfferPriceId; if (ddlProject.SelectedValue != "") { op.MainProjectCreateId = Convert.ToInt32(ddlProject.SelectedValue); } if (ddlEmployee.SelectedValue != "") { op.EmployeeId = Convert.ToInt32(ddlEmployee.SelectedValue); } op.OfferPriceTypeId = Convert.ToInt32(rblType.SelectedValue); DateTime date = DateTime.Now; string strtoday = DateTime.Now.ToString("yyyyMMdd").Substring(2); op.Today = strtoday; op.SheetNum = txtSheetNum.Text.ToString(); op.FillTableDate = Convert.ToDateTime(txtFillTableDate.Text.ToString()); op.SectionView = txtSectionView.Text.ToString(); op.SheetNum = txtSheetNum.Text.ToString(); op.ProjectDes = txtProjectDes.Text.ToString(); op.MoneySum = txtMoneySum.Text.ToString(); op.BigMoney = txtBigMoney.Text.ToString(); op.ProductMoneySum = lblMoneySum.Text.ToString(); if (UpFile.HasFile == true) { string name = this.UpFile.FileName; int startindex = this.UpFile.FileName.LastIndexOf(@"\") + 1; string fileName = this.UpFile.FileName.Substring(startindex); string phyFileName = this.Server.MapPath(@"~\Files\" + "OfferPrice") + @"\" + fileName; this.UpFile.SaveAs(phyFileName); OfferFileInfo of = new OfferFileInfo(); of.OfferFileName = fileName; //文件名 of.PhyFileName = UpFile.PostedFile.FileName; //本地文件路径 of.Save(); op.OfferFileId = Convert.ToInt32(of.OfferFileId); } op.SendEmployeeName = em.EmployeeName; op.SendEmployeeId = em.EmployeeId; op.PreIsApply = 1; op.PreIsOver = 1; op.IsApply = 0; op.IsApprove = 0; op.IsApply1 = 0; op.IsApply2 = 0; op.IsOver1 = 0; op.IsOver2 = 0; //GridView嵌套判断 op.IsMain = 1; op.IsMain1 = 1; op.IsMain2 = 1; op.IsMain3 = 1; op.IsNewCreate = 0; op.IsSignName = 0; op.Save(); if (UpFile.HasFile) { ////文件上传地址根目录,这里通过IIS架设本地主机为FTP服务器 //string FileSaveUri = @"ftp://192.168.11.70/www/Files/OfferPrice/"; ////FTP用户名密码,就是本机的用户名密码 //string ftpUser = "******"; //string ftpPassWord = "******"; //SendFiles(FileSaveUri, ftpUser, ftpPassWord); this.UpFile.PostedFile.SaveAs(Server.MapPath("~/Files/OfferPrice/" + UpFile.FileName)); } Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('添加成功!');</script>"); ViewState["Isbtn"] = "1"; txtSheetNum.Text = SheetNums.SheetNumOfOP("BJTB", strtoday); gvProductInitBind(); } catch (Exception Ex) { ClientScript.RegisterStartupScript(this.GetType(), "Save", "alert('添加失败:" + Ex.Message + "');", true); } } }