protected void btn_submit_Click(object sender, EventArgs e) { int ID = Convert.ToInt32(Request.QueryString["id"]); WebModels.Tbl_ProjectContract contract = WebBLL.Tbl_ProjectContractManager.GetTbl_ProjectContractById(ID); if (FileUpload1.FileName != "") { contract.PC_File = WebCommon.Public.UploadFile(FileUpload1, "ProjectContract"); } if (Status.Text != "") { contract.Status = Status.Text; } contract.PC_Price = Convert.ToDouble(this.PC_Price.Value); contract.PC_MoneyReceive = Convert.ToDouble(this.PC_MoneyReceive.Value); contract.PC_MoneyBill = Convert.ToDouble(this.PC_MoneyBill.Value); contract.PC_FeeType = this.PC_FeeType.SelectedValue; contract.DealUser = WebCommon.Public.GetUserName(); int count = WebBLL.Tbl_ProjectContractManager.UpdateTbl_ProjectContract(contract); if (count > 0) { ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('修改成功!');window.external.reload();window.external.close();", true); } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('修改失败!');", true); } }
public void Bind() { int ID = Convert.ToInt32(Request.QueryString["id"]); WebModels.Tbl_ProjectContract contract = WebBLL.Tbl_ProjectContractManager.GetTbl_ProjectContractById(ID); this.PC_Price.Value = Convert.ToString(contract.PC_Price); this.PC_MoneyReceive.Value = Convert.ToString(contract.PC_MoneyReceive); this.PC_MoneyBill.Value = Convert.ToString(contract.PC_MoneyBill); this.PC_FeeType.SelectedValue = contract.PC_FeeType; this.PC_Name.Value = contract.PC_Name; //审批权限 if (WebBLL.Tbl_ConfigManager.GetTbl_ConfigById(1).C_Set4.Contains(WebCommon.Public.GetUserName())) { this.Status.Enabled = true; } else { this.Status.Enabled = false; } }
protected void btn_submit_Click(object sender, EventArgs e) { WebModels.Tbl_ProjectContract contract = new WebModels.Tbl_ProjectContract(); contract.PC_Name = ProjectNo.Value; contract.ProjectID = Convert.ToInt32(this.ProjectID.SelectedValue); if (FileUpload1.FileName != "") { contract.PC_File = WebCommon.Public.UploadFile(FileUpload1, "ProjectContract"); } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert请上传合同附件!');", true); return; } contract.PC_Price = Convert.ToDouble(this.PC_Price.Value); contract.PC_MoneyReceive = Convert.ToDouble(this.PC_MoneyReceive.Value); contract.PC_MoneyBill = Convert.ToDouble(this.PC_MoneyBill.Value); contract.PC_FeeType = this.PC_FeeType.SelectedValue; contract.Status = "已审核";//this.Stauts.SelectedValue; contract.DealUser = WebCommon.Public.GetUserName(); try { int count = WebBLL.Tbl_ProjectContractManager.AddTbl_ProjectContract(contract); if (count > 0) { ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('添加成功,等待确认设总!');window.external.reload();window.external.close();", true); } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('添加失败!');", true); } } catch { ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('请检查该项目是否已经存在合同!');", true); } }