public void ShowTaskList(string prjcode, string prjname) { DataTable dataSource = new DataTable(); new DataTable(); this.Session["yhdm"].ToString(); string text = " and ((select PrjGuid from dbo.Fund_Prj_Accoun where accountid='" + base.Request.QueryString["ZHID"].ToString() + "') like '%'+CONVERT(VARCHAR(50),PrjGuid)+'%')"; if (!string.IsNullOrEmpty(prjcode)) { text = text + " and PrjCode like '%" + prjcode + "%' "; } if (!string.IsNullOrEmpty(prjname)) { text = text + "and PrjName like '%" + prjname + "%' "; } dataSource = PMPrjAction.getDTByWhere(text); this.grdModules.DataSource = dataSource; this.grdModules.DataBind(); }
protected void btnSave_Click(object sender, System.EventArgs e) { if (string.IsNullOrEmpty(this.ManagerCode.Value)) { this.Page.RegisterStartupScript("提示", "<script language=\"JavaScript\">alert(\"项目经理不能为空!\");</script>"); return; } string userCode = base.UserCode; System.DateTime now = System.DateTime.Now; string podepom = string.Empty; if (base.UserCode == "00000000") { podepom = "," + base.UserCode; } else { podepom = ",00000000," + base.UserCode; } string str = this.tbxPreCode.Text.Trim(); string text = this.TxtTypeCode.Text.Trim(); string recordDate = now.ToString(); PMModel pMModel = new PMModel(); pMModel = this.GetTextValue(); decimal childAllpri = PMAction.getChildAllpri(str + text); decimal perpri = PMAction.getPerpri(str + text); decimal childAllpriNotReg = PMAction.getChildAllpriNotReg(str + text); if (this.ViewState["OP"].ToString().ToLower() == "add") { if (PMAction.GetPrjInfoCount(str + text) > 0) { this.Page.RegisterStartupScript("提示", "<script language=\"JavaScript\">alert(\"分类编码已经存在,请纠正!\");</script>"); return; } if (!PMAction.CheckCode(pMModel.PrjCode)) { this.Page.RegisterStartupScript("提示", "<script language=\"JavaScript\">alert(\"编号重复!\");window.returnValue = true;window.close();</script>"); return; } if (this.txt_PrjCost.Text.ToString().Trim() != "") { } if (perpri != 0m) { if (PMAction.AddPrjInfo(str + text, userCode, recordDate, pMModel, podepom)) { this.BLL_n.update(pMModel.PrjGuid.ToString(), this.Txt_grade.Text.ToString().Trim(), this.ManagerCodeYW.Value.ToString() + "-" + this.Txt_businessman.Text.Trim().ToString(), this.Txt_telphone.Text.Trim().ToString()); string mes = string.Concat(new string[] { "项目立项通知:编号为", pMModel.PrjCode, "的", pMModel.PrjName, "项目已经立项。" }); this.getOrganiger(str + text, mes, this.ManagerCode.Value.ToString()); this.Page.RegisterStartupScript("提示", "<script language=\"JavaScript\">alert(\"保存成功!\");window.returnValue = true;window.close();</script>"); return; } this.Page.RegisterStartupScript("提示", "<script language=\"JavaScript\">alert(\"保存失败!\");window.returnValue = true;window.close();</script>"); return; } else { if (PMAction.AddPrjInfo(str + text, userCode, recordDate, pMModel, podepom)) { this.BLL_n.update(pMModel.PrjGuid.ToString(), this.Txt_grade.Text.ToString().Trim(), this.ManagerCodeYW.Value.ToString() + "-" + this.Txt_businessman.Text.Trim().ToString(), this.Txt_telphone.Text.Trim().ToString()); string mes2 = string.Concat(new string[] { "项目立项通知:编号为", pMModel.PrjCode, "的", pMModel.PrjName, "项目已经立项。" }); this.getOrganiger(str + text, mes2, this.ManagerCode.Value.ToString()); this.Page.RegisterStartupScript("提示", "<script language=\"JavaScript\">alert(\"保存成功!\");window.returnValue = true;window.close();</script>"); return; } this.Page.RegisterStartupScript("提示", "<script language=\"JavaScript\">alert(\"保存失败!\");window.returnValue = true;window.close();</script>"); return; } } else { if (this.txt_PrjCost.Text.ToString().Trim() != "") { } if (!PMAction.UpCheckCode(this.ViewState["oldPrjcode"].ToString().Trim(), pMModel.PrjCode)) { this.LabcodeWR.Text = "编号重复"; return; } if (childAllpri == 0m) { if (PMAction.UpdPrjInfo(text, userCode, recordDate, pMModel)) { PMPrjAction.updatePrjCode(pMModel.PrjCode, pMModel.PrjGuid.ToString()); this.Page.RegisterStartupScript("提示", "<script language=\"JavaScript\">alert(\"保存成功!\");window.returnValue = true;window.close();</script>"); return; } this.Page.RegisterStartupScript("提示", "<script language=\"JavaScript\">alert(\"保存失败!\");</script>"); return; } else { if (PMAction.UpdPrjInfo(text, userCode, recordDate, pMModel)) { this.Page.RegisterStartupScript("提示", "<script language=\"JavaScript\">alert(\"保存成功!\");window.returnValue = true;window.close();</script>"); return; } this.Page.RegisterStartupScript("提示", "<script language=\"JavaScript\">alert(\"保存失败!\");</script>"); return; } } }