/// <summary> /// 生成sql语句 /// </summary> private void BuildSqlString() { try { RmsPM.DAL.QueryStrategy.WorkFlowHistory sb = new RmsPM.DAL.QueryStrategy.WorkFlowHistory(); sb.AddStrategy(new Strategy(WorkFlowHistoryStrategyName.ProcedureNameAndApplicationCodein, this.ProcedureNameAndApplicationCodeList)); if (IsEndFlow) { sb.AddStrategy(new Strategy(RmsPM.DAL.QueryStrategy.WorkFlowHistoryStrategyName.Status, "End")); } if (!((User)Session["User"]).HasOperationRight("090102")) { sb.AddStrategy(new Strategy(WorkFlowHistoryStrategyName.ActUserCode, ((User)Session["User"]).UserCode)); } sb.AddOrder("CreateDate", false); string sql = sb.BuildMainQueryString(); this.ViewState.Add("SqlString", sql); } catch (Exception ex) { throw ex; } }
private void LoadSurvey() { try { string SupplierCode = Request["SupplierCode"] + ""; RmsPM.BLL.SupplierSurveyOpinion cSupplierSurveyOpinion = new SupplierSurveyOpinion(); cSupplierSurveyOpinion.SupplierCode = SupplierCode; //cSupplierSurveyOpinion.State = "0"; System.Data.DataTable dtSupplierSurveyOpinion = cSupplierSurveyOpinion.GetSupplierSurveyOpinions(); RmsPM.DAL.QueryStrategy.WorkFlowHistory sbSupplierSurveyOpinion = new RmsPM.DAL.QueryStrategy.WorkFlowHistory(); sbSupplierSurveyOpinion.AddStrategy(new Strategy(WorkFlowHistoryStrategyName.ProcedureNameAndApplicationCodein, this.GetSurveyListString(dtSupplierSurveyOpinion))); if (!((User)Session["User"]).HasOperationRight("090102")) { sbSupplierSurveyOpinion.AddStrategy(new Strategy(WorkFlowHistoryStrategyName.ActUserCode, ((User)Session["User"]).UserCode)); } sbSupplierSurveyOpinion.AddOrder("CreateDate", false); string sqlSupplierSurveyOpinion = sbSupplierSurveyOpinion.BuildMainQueryString(); QueryAgent qaSupplierSurveyOpinion = new QueryAgent(); DataSet dsSupplierSurveyOpinion = qaSupplierSurveyOpinion.ExecSqlForDataSet(sqlSupplierSurveyOpinion); qaSupplierSurveyOpinion.Dispose(); if (dsSupplierSurveyOpinion != null) { DataTable dttempSupplierSurveyOpinion = dsSupplierSurveyOpinion.Tables[0]; dttempSupplierSurveyOpinion.Columns.Add("ZYName", System.Type.GetType("System.String")); dttempSupplierSurveyOpinion.Columns.Add("State", System.Type.GetType("System.String")); dttempSupplierSurveyOpinion.Columns.Add("SupplierCode", System.Type.GetType("System.String")); dttempSupplierSurveyOpinion.Columns.Add("Grade", System.Type.GetType("System.String")); dttempSupplierSurveyOpinion.Columns.Add("AdviceGrade", System.Type.GetType("System.String")); dttempSupplierSurveyOpinion.Columns.Add("SurveyDate", System.Type.GetType("System.String")); foreach (DataRow dr in dttempSupplierSurveyOpinion.Select()) { if (dtSupplierSurveyOpinion.Select("SupplierSurveyOpinionCode='" + dr["ApplicationCode"] + "'").Length != 0) { dr["ZYName"] = dtSupplierSurveyOpinion.Select("SupplierSurveyOpinionCode='" + dr["ApplicationCode"] + "'")[0]["ZYName"].ToString(); dr["State"] = dtSupplierSurveyOpinion.Select("SupplierSurveyOpinionCode='" + dr["ApplicationCode"] + "'")[0]["State"].ToString(); dr["SupplierCode"] = dtSupplierSurveyOpinion.Select("SupplierSurveyOpinionCode='" + dr["ApplicationCode"] + "'")[0]["SupplierCode"].ToString(); dr["Grade"] = dtSupplierSurveyOpinion.Select("SupplierSurveyOpinionCode='" + dr["ApplicationCode"] + "'")[0]["Grade"].ToString(); dr["AdviceGrade"] = dtSupplierSurveyOpinion.Select("SupplierSurveyOpinionCode='" + dr["ApplicationCode"] + "'")[0]["AdviceGrade"].ToString(); dr["SurveyDate"] = dtSupplierSurveyOpinion.Select("SupplierSurveyOpinionCode='" + dr["ApplicationCode"] + "'")[0]["SurveyDate"].ToString(); } } dgsurvey.DataSource = dttempSupplierSurveyOpinion; dgsurvey.DataBind(); } //RmsPM.BLL.SupplierSurveyOpinion cSupplierSurveytemp = new SupplierSurveyOpinion(); //cSupplierSurveytemp.SupplierCode = SupplierCode; //cSupplierSurveytemp.State = "0"; //DataTable dtSupplierSurveytemp = cSupplierSurveytemp.GetSupplierSurveyOpinions(); //if (dtSupplierSurveytemp.Rows.Count != 0) //{ // this.lblQualityGrade.Text = dtSupplierSurveytemp.Rows[0]["Grade"].ToString(); // // 权限 // if (!this.user.HasRight("140106")) // this.btnModify.Visible = false; //} //else //{ // this.lblQualityGrade.Text = "未定"; //} } catch (Exception ex) { ApplicationLog.WriteLog(this.ToString(), ex, "载入调查意见出错"); Response.Write(Rms.Web.JavaScript.Alert(true, "载入调查意见出错")); } }
private void LoadData() { if (user.HasRight("2702")) { this.btnNewWorkFlow.Visible = true; } if (user.HasRight("2709")) { this.btnNewPursveWorkflow.Visible = true; } GradeMessage gm = new GradeMessage(); string projectCode = Request["ProjectCode"] + ""; string SupplierCode = this.txtSupplierCode.Value; string ProjectManage = this.txtProjectManage.Value; string Status = ""; for (int i = 0; i < this.cblStatus.Items.Count; i++) { if (this.cblStatus.Items[i].Selected) { if (Status != "") { Status = Status + ","; } Status = this.cblStatus.Items[i].Value; } } if (ProjectManage != "") { gm.ProjectManage = "%" + ProjectManage + "%"; } if (SupplierCode != "") { gm.SupplierCode = SupplierCode; } if (Status != "") { gm.State = Status; } if (this.ddlWorkFlowTypeView.SelectedValue != "") { gm.MainDefineCode = this.ddlWorkFlowTypeView.SelectedValue; } gm.ProjectCode = projectCode; DataTable dtGradeMessage = gm.GetGradeMessages(); RmsPM.DAL.QueryStrategy.WorkFlowHistory sb = new RmsPM.DAL.QueryStrategy.WorkFlowHistory(); sb.AddStrategy(new Strategy(WorkFlowHistoryStrategyName.ProcedureNameAndApplicationCodein, this.GetWorkFlowListString(dtGradeMessage))); if (!((User)Session["User"]).HasOperationRight("090102")) { sb.AddStrategy(new Strategy(WorkFlowHistoryStrategyName.ActUserCode, ((User)Session["User"]).UserCode)); } sb.AddOrder("CreateDate", false); string sql = sb.BuildMainQueryString(); QueryAgent qa = new QueryAgent(); DataSet ds = qa.ExecSqlForDataSet(sql); qa.Dispose(); if (ds != null) { DataTable dttempgradeMessage = ds.Tables[0]; dttempgradeMessage.Columns.Add("ProjectManage", System.Type.GetType("System.String")); dttempgradeMessage.Columns.Add("State", System.Type.GetType("System.String")); dttempgradeMessage.Columns.Add("SupplierCode", System.Type.GetType("System.String")); foreach (DataRow dr in dttempgradeMessage.Select()) { if (dtGradeMessage.Select("GradeMessageCode='" + dr["ApplicationCode"] + "'").Length != 0) { dr["ProjectManage"] = dtGradeMessage.Select("GradeMessageCode='" + dr["ApplicationCode"] + "'")[0]["ProjectManage"].ToString(); dr["State"] = dtGradeMessage.Select("GradeMessageCode='" + dr["ApplicationCode"] + "'")[0]["State"].ToString(); dr["SupplierCode"] = dtGradeMessage.Select("GradeMessageCode='" + dr["ApplicationCode"] + "'")[0]["SupplierCode"].ToString(); } } this.dgList.DataSource = dttempgradeMessage; this.dgList.DataBind(); } }
private void LoadData() { try { //基本信息 string SupplierCode = Request["SupplierCode"] + ""; string projectCode = Request["projectCode"] + ""; EntityData entity = ProjectDAO.GetStandard_SupplierByCode(SupplierCode); if (entity.HasRecord()) { this.lblSupplierName.Text = entity.GetString("SupplierName"); this.lblAbbreviation.Text = entity.GetString("Abbreviation"); this.lblAreaCode.Text = entity.GetString("AreaCode"); this.lblProduct.Text = entity.GetString("Product").Replace("\n", "<br>"); this.lblQuality.Text = entity.GetString("Quality").Replace("\n", "<br>"); this.lblAchievement.Text = entity.GetString("Achievement").Replace("\n", "<br>"); this.lblCheckOpinion.Text = entity.GetString("CheckOpinion").Replace("\n", "<br>"); this.lblContractPerson.Text = entity.GetString("ContractPerson"); this.lblCreditLevel.Text = entity.GetString("CreditLevel"); this.lblIndustrySort.Text = entity.GetString("IndustrySort"); this.lblIndustryType.Text = entity.GetString("IndustryType"); this.lblLicenseID.Text = entity.GetString("LicenseID"); this.lblOfficePhone.Text = entity.GetString("OfficePhone"); this.lblMobile.Text = entity.GetString("Mobile"); this.lblFax.Text = entity.GetString("Fax"); this.lblPostCode.Text = entity.GetString("PostCode"); this.lblEmail.Text = entity.GetString("EMail"); this.lblWebAddress.Text = entity.GetString("WebAddress"); this.lblRegisteredAddress.Text = entity.GetString("RegisteredAddress"); this.lblRegisteredCapital.Text = entity.GetString("RegisteredCapital"); this.lblSJHG.Text = entity.GetString("SJHG"); this.lblTaxID.Text = entity.GetString("TaxID"); this.lblTaxNo.Text = entity.GetString("TaxNo"); this.lblWorkAddress.Text = entity.GetString("WorkAddress"); this.lblWorkTimeLimit.Text = entity.GetString("WorkTimeLimit"); this.lblArtificialPerson.Text = entity.GetString("ArtificialPerson"); this.lblWorkScope.Text = entity.GetString("WorkScope"); this.lblStructure.Text = entity.GetString("Structure"); this.lblRemark.Text = entity.GetString("Remark"); this.lblTypeName.Text = BLL.ProjectRule.GetSupplierTypeName(entity.GetString("SupplierTypeCode")); this.lblSaleType.Text = entity.GetString("saleType"); this.lblCharacterType.Text = entity.GetString("characterType"); this.lblCCC.Text = RmsPM.BLL.SupplierRule.GetTypeName(entity.GetString("IsCCC")); this.lblISO.Text = RmsPM.BLL.SupplierRule.GetTypeName(entity.GetString("IsISO")); this.lblQualityGrade.Text = entity.GetString("QualityGrade") == "" ? "未定" : entity.GetString("QualityGrade"); this.lblOpenBank.Text = entity.GetString("OpenBank"); this.lblReciver.Text = entity.GetString("Reciver"); this.lblAccount.Text = entity.GetString("Account"); } switch (this.up_sPMName.ToLower()) { case "shidaipm": this.isAuditted.Visible = true; this.TdisAuditted.Visible = true; this.isAuditted.Text = RmsPM.BLL.SupplierRule.GetIsAuditted(entity.GetInt("Status")); this.PreWorkFlowPoint.ColSpan = 4; break; case "shimaopm": this.btnGradeAdd.Visible = this.user.HasRight("2701"); this.btnPursveWorkflow.Visible = this.user.HasRight("2709"); this.DataGrid_supplierRecord.Visible = false; this.DataGrid_supplierGrade.Visible = true; RmsPM.BLL.GradeMessage cgradeMessage = new GradeMessage(); cgradeMessage.SupplierCode = SupplierCode; //cgradeMessage.State = "0"; System.Data.DataTable dtGradeMessage = cgradeMessage.GetGradeMessages(); RmsPM.DAL.QueryStrategy.WorkFlowHistory sbGradeMessage = new RmsPM.DAL.QueryStrategy.WorkFlowHistory(); sbGradeMessage.AddStrategy(new Strategy(WorkFlowHistoryStrategyName.ProcedureNameAndApplicationCodein, this.GetWorkFlowListString(dtGradeMessage))); if (!((User)Session["User"]).HasOperationRight("090102")) { sbGradeMessage.AddStrategy(new Strategy(WorkFlowHistoryStrategyName.ActUserCode, ((User)Session["User"]).UserCode)); } sbGradeMessage.AddOrder("CreateDate", false); string sqlGradeMessage = sbGradeMessage.BuildMainQueryString(); QueryAgent qaGradeMessage = new QueryAgent(); DataSet dsGradeMessage = qaGradeMessage.ExecSqlForDataSet(sqlGradeMessage); qaGradeMessage.Dispose(); if (dsGradeMessage != null) { DataTable dttempgradeMessage = dsGradeMessage.Tables[0]; dttempgradeMessage.Columns.Add("ProjectManage", System.Type.GetType("System.String")); dttempgradeMessage.Columns.Add("State", System.Type.GetType("System.String")); dttempgradeMessage.Columns.Add("SupplierCode", System.Type.GetType("System.String")); foreach (DataRow dr in dttempgradeMessage.Select()) { if (dtGradeMessage.Select("GradeMessageCode='" + dr["ApplicationCode"] + "'").Length != 0) { dr["ProjectManage"] = dtGradeMessage.Select("GradeMessageCode='" + dr["ApplicationCode"] + "'")[0]["ProjectManage"].ToString(); dr["State"] = dtGradeMessage.Select("GradeMessageCode='" + dr["ApplicationCode"] + "'")[0]["State"].ToString(); dr["SupplierCode"] = dtGradeMessage.Select("GradeMessageCode='" + dr["ApplicationCode"] + "'")[0]["SupplierCode"].ToString(); } } this.DataGrid_supplierGrade.DataSource = dttempgradeMessage; this.WorkFlowPoint.Visible = true; this.lblGradePoint.Visible = true; if (dtGradeMessage.Select("state='0'").Length != 0) { this.lblGradePoint.Text = RmsPM.BLL.GradeList.GetSumGradePoint(dtGradeMessage.Select("state='0'")[0]["GradeMessageCode"].ToString()); } this.DataGrid_supplierGrade.DataBind(); } this.PreAuditted.ColSpan = 4; break; default: this.btnPG.Visible = true; this.DataGrid_supplierRecord.Visible = true; this.DataGrid_supplierGrade.Visible = false; this.isAuditted.Visible = false; this.TdisAuditted.Visible = false; this.PreAuditted.ColSpan = 4; this.PreWorkFlowPoint.ColSpan = 4; DataGrid_supplierRecord.DataSource = new DataView(entity.Tables["SupplierOpinion"], "", "OpinionDate DESC", DataViewRowState.CurrentRows); DataGrid_supplierRecord.DataBind(); break; } ContractStrategyBuilder sb = new ContractStrategyBuilder(); sb.AddStrategy(new Strategy(ContractStrategyName.SupplierCode, SupplierCode)); sb.AddStrategy(new Strategy(ContractStrategyName.Status, "0,1,2")); if (projectCode != "") { sb.AddStrategy(new Strategy(ContractStrategyName.ProjectCode, projectCode)); } ArrayList arAccess = new ArrayList(); arAccess.Add("050101"); arAccess.Add(user.UserCode); arAccess.Add(user.BuildStationCodes()); sb.AddStrategy(new Strategy(ContractStrategyName.AccessRange, arAccess)); string sql = sb.BuildMainQueryString(); QueryAgent qa = new QueryAgent(); EntityData contract = qa.FillEntityData("Contract", sql); qa.Dispose(); contract.CurrentTable.Columns.Add("TypeName"); contract.CurrentTable.Columns.Add("StatusName"); contract.CurrentTable.Columns.Add("CheckDisplay"); //是否有权限审核,控制按钮的显示隐藏 contract.CurrentTable.Columns.Add("AHMoney", System.Type.GetType("System.Decimal")); contract.CurrentTable.Columns.Add("PHMoney", System.Type.GetType("System.Decimal")); int iCount = contract.CurrentTable.Rows.Count; for (int i = 0; i < iCount; i++) { contract.SetCurrentRow(i); contract.CurrentRow["TypeName"] = BLL.ContractRule.GetContractTypeName(contract.GetString("Type")); contract.CurrentRow["StatusName"] = BLL.ContractRule.GetContractStatusName(contract.GetInt("Status").ToString()); decimal ah = BLL.ContractRule.GetContractPayment(contract.GetString("ContractCode")); decimal totalMoney = contract.GetDecimal("TotalMoney"); contract.CurrentRow["AHMoney"] = ah; contract.CurrentRow["PHMoney"] = totalMoney - ah; } this.dgContract.DataSource = contract; this.dgContract.DataBind(); contract.Dispose(); LoadDocument(); // 当前厂商询价记录 LoadEnquiry(); //当前厂商联系人 LoadLinkman(); //厂商财务编码 LoadSupplierSubjectSet(entity); //添加调查意见 LoadSurvey(); //加载公司主题 LoadCompanyTitle(); entity.Dispose(); } catch (Exception ex) { ApplicationLog.WriteLog(this.ToString(), ex, "载入页面出错"); Response.Write(Rms.Web.JavaScript.Alert(true, "载入页面出错")); } }