private void DataGrid1_ItemCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) { try { if (e.CommandName == "Read") { string strSql = "select * from tbProject where cnnProjectID=" + e.Item.Cells[1].Text; DataTable dtProject = Helper.Query(strSql); if (dtProject.Rows.Count > 0) { Project project = new Project(dtProject); if (project.cnvcProjectState != "P001") { throw new Exception("商机不在发布状态"); } if (project.cnvcMgr != oper.cnvcOperID || project.cnvcTradeMgr != oper.cnvcOperID) { throw new Exception("只有客户经理才可以收阅"); } project.cnvcProjectState = "P002"; ChanceFacade.UpdateProject(project, oper); //Popup("已收阅"); this.BindGrid(); } } } catch (Exception ex) { Popup(ex.Message); } }
private void btnOK_Click(object sender, System.EventArgs e) { try { if (!this.JudgeIsNum(txtSucessIncome.Text, "转化收入")) { return; } if (this.JudgeIsNull(txtSucessDate.Text, "转化时间")) { return; } DataTable dtProject = Helper.Query("select * from tbProject where cnnProjectID=" + txtProjectID.Text); Project project = new Project(dtProject); if (project.cnvcMgr != oper.cnvcOperID && project.cnvcTradeMgr != oper.cnvcOperID && project.cnvcOperID != oper.cnvcOperID) { throw new Exception("只有客户经理或者行业经理才可以转化"); } if (this.txtContractNo.Text.Trim() == "" || this.txtProjectName2.Text.Trim() == "" || this.txtSucessIncome.Text.Trim() == "0") { throw new Exception("请如实填写客户信息转化,有为空信息"); } string strSucess = project.cnvcIsSucess; if (project.cnvcIsSucess != "0") { throw new Exception("商机已转化,不能再次操作!"); } project.cnvcIsSucess = "1"; project.cnvcProjectName = txtProjectName2.Text; project.cnvcContractNo = txtContractNo.Text; project.cndSucessDate = Convert.ToDateTime(txtSucessDate.Text); project.cnnSucessIncome = Convert.ToDecimal(txtSucessIncome.Text); project.cnvcProjectState = "P004"; ChanceFacade.UpdateProject(project, oper); if (strSucess == "0") { Popup("商机转化成功"); } else { Popup("商机转化信息修改成功"); } //this.CleanCtrl(); } catch (Exception ex) { Popup(ex.Message); } }
private void btnOK_Click(object sender, System.EventArgs e) { try { if (this.JudgeIsNull(txtProjectName.Text, "商机名称")) { return; } if (!this.JudgeIsNum(txtForecastIncome.Text, "预测收入")) { return; } if (this.JudgeIsNull(txtChanceDate.Text, "商机时间")) { return; } DataTable dtProject = Helper.Query("select * from tbProject where cnnProjectID=" + txtProjectID.Text); Project project = new Project(dtProject); if (project.cnvcMgr != oper.cnvcOperID && project.cnvcOperID != oper.cnvcOperID) { throw new Exception("只有发布者或者客户经理才可以修改"); } project.cnvcChanceName = txtProjectName.Text; project.cnnCustID = Convert.ToDecimal(txtCustID.Text); project.cnnForecastIncome = Convert.ToDecimal(txtForecastIncome.Text); project.cnvcChanceSpeed = ddlChanceSpeed.SelectedValue; project.cnvcChanceType = ddlChanceType2.SelectedValue; project.cnvcComments = txtComments.Text; project.cnvcDeptID = ddlDept.SelectedValue; project.cnvcMgr = ddlMgr.SelectedValue; project.cnvcTradeMgr = ddlTradeMgr.SelectedValue; project.cndChanceDate = Convert.ToDateTime(txtChanceDate.Text); ChanceFacade.UpdateProject(project, oper); Popup("商机修改成功"); //this.CleanCtrl(); } catch (Exception ex) { Popup(ex.Message); } }