Esempio n. 1
0
        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, "载入页面出错"));
            }
        }
Esempio n. 2
0
        private void LoadData()
        {
            string SupplierCode = Request.QueryString["SupplierCode"] + "";

            try
            {
                EntityData entity = ProjectDAO.GetStandard_SupplierByCode(SupplierCode);

                if (entity.HasRecord())
                {
                    this.txtArtificialPerson.Text  = entity.GetString("ArtificialPerson");
                    this.txtAbbreviation.Text      = entity.GetString("Abbreviation");
                    this.txtCheckOpinion.Text      = entity.GetString("CheckOpinion");
                    this.txtContractPerson.Text    = entity.GetString("ContractPerson");
                    this.txtEmail.Text             = entity.GetString("Email");
                    this.txtIndustrySort.Text      = entity.GetString("IndustrySort");
                    this.txtIndustryType.Text      = entity.GetString("IndustryType");
                    this.txtLicenseID.Text         = entity.GetString("LicenseID");
                    this.txtOfficePhone.Text       = entity.GetString("OfficePhone");
                    this.txtPostCode.Text          = entity.GetString("PostCode");
                    this.txtProduct.Text           = entity.GetString("Product");
                    this.txtQuality.Text           = entity.GetString("Quality");
                    this.txtRegisteredAddress.Text = entity.GetString("RegisteredAddress");
                    this.txtRegisteredCapital.Text = entity.GetString("RegisteredCapital");
                    this.txtSJHG.Text = entity.GetString("SJHG");
                    string typeCode = entity.GetString("SupplierTypeCode");
                    this.inputSystemGroup.Value = typeCode;
                    this.txtSupplierName.Text   = entity.GetString("SupplierName");
                    this.txtTaxID.Text          = entity.GetString("TaxID");
                    this.txtTaxNo.Text          = entity.GetString("TaxNo");
                    //					this.txtU8Code.Text = entity.GetString("U8Code");
                    this.txtWebAddress.Text    = entity.GetString("WebAddress");
                    this.txtWorkAddress.Text   = entity.GetString("WorkAddress");
                    this.txtWorkTimeLimit.Text = entity.GetString("WorkTimeLimit");

                    this.txtAreaCode.Text    = entity.GetString("AreaCode");
                    this.txtMobile.Text      = entity.GetString("Mobile");
                    this.txtFax.Text         = entity.GetString("Fax");
                    this.txtAchievement.Text = entity.GetString("Achievement");
                    this.txtCreditLevel.Text = entity.GetString("CreditLevel");

                    this.txtWorkScope.Text = entity.GetString("WorkScope");
                    this.txtStructure.Text = entity.GetString("Structure");
                    this.txtRemark.Text    = entity.GetString("Remark");

                    SupplierRule.LoadDictionarySelect(this.selSaleType, "销售形式", entity.GetString("saleType"));
                    SupplierRule.LoadDictionarySelect(this.selCharacterType, "品质类别", entity.GetString("characterType"));
                    this.selCCC.Value = entity.GetString("IsCCC");
                    this.selISO.Value = entity.GetString("IsISO");
                    // Added by yiwl at 2007-03-08
                    this.tbxOpenBank.Text = entity.GetString("OpenBank");
                    this.tbxAccount.Text  = entity.GetString("Account");
                    this.tbxReciver.Text  = entity.GetString("Reciver");

                    switch (this.up_sPMName.ToLower())
                    {
                    case "tangchenpm":
                        this.selQualityGrade.Visible  = false;
                        this.tdQualityGrade.InnerHtml = entity.GetString("QualityGrade") + "&nbsp;";
                        break;

                    default:
                        SupplierRule.LoadDictionarySelect(this.selQualityGrade, "资质等级", entity.GetString("QualityGrade"));
                        break;
                    }
                }
                else
                {
                    SupplierRule.LoadDictionarySelect(this.selSaleType, "销售形式", "");
                    SupplierRule.LoadDictionarySelect(this.selCharacterType, "品质类别", "");
                }

                entity.Dispose();
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "载入页面出错");
                Response.Write(Rms.Web.JavaScript.Alert(true, "载入页面出错:" + ex.Message));
            }
        }