コード例 #1
0
ファイル: GetSupplierData.aspx.cs プロジェクト: riyuexing/rms
        protected void Page_Load(object sender, System.EventArgs e)
        {
            // 在此处放置用户代码以初始化页面
            string Value = Request.QueryString["Value"] + "";
            string Type  = Request.QueryString["Type"] + "";

            string SupplierCode     = "";
            string SupplierName     = "";
            string SupplierFullName = "";
            string SortID           = "";
            string Hint             = "";
            string IsExists         = "";

            if (Value != "")
            {
                EntityData entity = null;

                try
                {
                    SupplierStrategyBuilder sb = new SupplierStrategyBuilder();

                    if (SupplierName != "")
                    {
                        sb.AddStrategy(new Strategy(SupplierStrategyName.SupplierName, "%" + SupplierName + "%"));
                    }

                    string sql = sb.BuildMainQueryString();

                    QueryAgent qa = new QueryAgent();
                    entity = qa.FillEntityData("Supplier", sql);
                    qa.Dispose();
                }
                catch (Exception ex)
                {
                    throw ex;
                }

                switch (entity.Tables["Supplier"].Rows.Count)
                {
                case 0:
                    Hint = "该供应商不存在 !";
                    break;

                case 1:
                    SupplierCode     = entity.GetString("SupplierCode");
                    SupplierFullName = entity.GetString("SupplierName");
                    IsExists         = "1";
                    break;

                default:
                    Hint = "请继续输入以确定唯一的供应商 !";
                    break;
                }
            }

            string sResult = "<Result>"
                             + "<SupplierCode>" + SupplierCode + "</SupplierCode>"
                             + "<SupplierName>" + SupplierName + "</SupplierName>"
                             + "<SupplierFullName>" + SupplierFullName + "</SupplierFullName>"
                             + "<SortID>" + SortID + "</SortID>"
                             + "<Hint>" + Hint + "</Hint>"
                             + "<IsExists>" + IsExists + "</IsExists>"
                             + "</Result>";

            Response.Write(sResult);
            Response.End();
        }
コード例 #2
0
ファイル: SupplierModify.aspx.cs プロジェクト: riyuexing/rms
        protected void btnSave_ServerClick(object sender, System.EventArgs e)
        {
            string supplierCode = Request["SupplierCode"] + "";
            bool   isNew        = (supplierCode == "");

            if (this.txtSupplierName.Text.Trim() == "")
            {
                Response.Write(Rms.Web.JavaScript.Alert(true, "请填写厂商名称 !"));
                return;
            }

            if (this.inputSystemGroup.Value == "")
            {
                Response.Write(Rms.Web.JavaScript.Alert(true, "请填写厂商类型 !"));
                return;
            }

            if (System.Configuration.ConfigurationSettings.AppSettings["PMName"] + "" == "YinRunPM")
            {
                if (this.txtContractPerson.Text.Trim() == "")
                {
                    Response.Write(Rms.Web.JavaScript.Alert(true, "请填写联系人 !"));
                    return;
                }
                if (this.txtOfficePhone.Text.Trim() == "")
                {
                    Response.Write(Rms.Web.JavaScript.Alert(true, "请填写联系电话 !"));
                    return;
                }
            }

            if (isNew)
            {
                if (!user.HasTypeOperationRight("140102", this.inputSystemGroup.Value))
                {
                    Response.Write(Rms.Web.JavaScript.Alert(true, "您没有权限操作这类厂商 !"));
                }
            }

            //			string subjectSetCode = Request["SubjectSetCode"];

            try
            {
                //检查厂商不能重名
                SupplierStrategyBuilder sb = new SupplierStrategyBuilder();
                ArrayList ar = new ArrayList();

                ar.Add(supplierCode);
                ar.Add(this.txtSupplierName.Text.Trim());
                ar.Add(this.txtAbbreviation.Text.Trim());

                sb.AddStrategy(new Strategy(SupplierStrategyName.CheckName, ar));

                string     sql       = sb.BuildMainQueryString();
                QueryAgent qa        = new QueryAgent();
                DataSet    checkName = qa.ExecSqlForDataSet(sql);
                qa.Dispose();
                int checkNameCount = checkName.Tables[0].Rows.Count;

                if (checkNameCount > 0)
                {
                    //检查类别是否也相同(不同类别允许重名) xyq 2006.2.22
                    DataRow[] drs = checkName.Tables[0].Select("SupplierTypeCode = '" + this.inputSystemGroup.Value + "'");

                    if (drs.Length > 0)
                    {
                        Response.Write(Rms.Web.JavaScript.Alert(true, "该类型下发现重名厂商 !"));
                        return;
                    }
                }

                checkName.Dispose();

                EntityData entity = null;
                DataRow    dr     = null;

                if (isNew)
                {
                    entity             = new EntityData("Standard_Supplier");
                    dr                 = entity.GetNewRecord();
                    supplierCode       = SystemManageDAO.GetNewSysCode("SupplierCode").ToString();
                    dr["SupplierCode"] = supplierCode;
                    dr["Status"]       = 0;
                    entity.AddNewRecord(dr);
                    //					dr["SubjectSetCode"]=subjectSetCode;
                }
                else
                {
                    entity = DAL.EntityDAO.ProjectDAO.GetStandard_SupplierByCode(supplierCode);
                    dr     = entity.CurrentRow;
                }

                //				dr["U8Code"] = this.txtU8Code.Text;
                dr["SupplierName"]      = this.txtSupplierName.Text;
                dr["Quality"]           = this.txtQuality.Text;
                dr["RegisteredCapital"] = txtRegisteredCapital.Text;
                dr["Product"]           = txtProduct.Text;
                dr["CheckOpinion"]      = txtCheckOpinion.Text;
                dr["SupplierTypeCode"]  = this.inputSystemGroup.Value;
                dr["ArtificialPerson"]  = txtArtificialPerson.Text;
                dr["Abbreviation"]      = this.txtAbbreviation.Text;
                dr["ContractPerson"]    = txtContractPerson.Text;
                dr["OfficePhone"]       = txtOfficePhone.Text;
                dr["RegisteredAddress"] = txtRegisteredAddress.Text;
                dr["IndustryType"]      = txtIndustryType.Text;
                dr["IndustrySort"]      = txtIndustrySort.Text;
                dr["SJHG"]          = txtSJHG.Text;
                dr["LicenseID"]     = txtLicenseID.Text;
                dr["TaxID"]         = txtTaxID.Text;
                dr["TaxNo"]         = txtTaxNo.Text;
                dr["WorkAddress"]   = txtWorkAddress.Text;
                dr["WorkTimeLimit"] = txtWorkTimeLimit.Text;
                dr["PostCode"]      = txtPostCode.Text;
                dr["EMail"]         = this.txtEmail.Text;
                dr["WebAddress"]    = txtWebAddress.Text;

                dr["AreaCode"]    = this.txtAreaCode.Text;
                dr["Mobile"]      = this.txtMobile.Text;
                dr["Fax"]         = this.txtFax.Text;
                dr["Achievement"] = this.txtAchievement.Text;
                dr["CreditLevel"] = this.txtCreditLevel.Text;
                dr["Workscope"]   = this.txtWorkScope.Text;
                dr["Structure"]   = this.txtStructure.Text;
                dr["Remark"]      = this.txtRemark.Text;

                dr["saleType"]      = this.selSaleType.Value;
                dr["characterType"] = this.selCharacterType.Value;
                dr["IsCCC"]         = this.selCCC.Value;
                dr["IsISO"]         = this.selISO.Value;
                //Added by yiwl at 2007-03-08
                dr["OpenBank"] = this.tbxOpenBank.Text;
                dr["Account"]  = this.tbxAccount.Text;
                dr["Reciver"]  = this.tbxReciver.Text;
                switch (this.up_sPMName.ToLower())
                {
                case "tangchenpm":
                    break;

                default:
                    dr["QualityGrade"] = this.selQualityGrade.Value;
                    break;
                }

                DAL.EntityDAO.ProjectDAO.SubmitAllStandard_Supplier(entity);

                entity.Dispose();

                Response.Write(Rms.Web.JavaScript.ScriptStart);
                Response.Write(Rms.Web.JavaScript.OpenerReload(false));
                Response.Write(Rms.Web.JavaScript.WinClose(false));
                Response.Write(Rms.Web.JavaScript.ScriptEnd);
                Response.Write("<script>window.close();</script>");
            }


            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "");
                Response.Write(Rms.Web.JavaScript.Alert(true, "保存出错:" + ex.Message));
            }
        }
コード例 #3
0
        private void BuildSearchString()
        {
            string IsEmpty = Request["IsEmpty"] + "";

            string SupplierTypeCode  = Request["SupplierTypeCode"] + "";
            string SupplierName      = Request["SupplierName"] + "";
            string Abbreviation      = Request["Abbreviation"] + "";
            string AreaCode          = Request["AreaCode"] + "";
            string Quality           = Request["Quality"] + "";
            string RegisteredAddress = Request["RegisteredAddress"] + "";
            string ContractPerson    = Request["ContractPerson"] + "";
            string IndustryType      = Request["IndustryType"] + "";
            string Achievement       = Request["Achievement"] + "";
            string CheckOpinion      = Request["CheckOpinion"] + "";

            string chkSearch = Request["ChkSearch"] + "";
            //品质类别
            string characterType = Request["CharacterType"] + "";
            //信用登级
            string CreditLevel = Request["CreditLevel"] + "";

            //合作与否
            string IsExistsContract = Request["IsExistsContract"] + "";
            string SellForm         = Request["SellForm"] + "";
            string cccAttestation   = Request["cccAttestation"] + "";
            string isoAttestation   = Request["isoAttestation"] + "";
            string QualityLevel     = Request["QualityLevel"] + "";
            string IsAuditted       = "";

            //时代厂商需要审核
            if (this.up_sPMNameLower == "shidaipm")
            {
                IsAuditted = Request["IsAuditted"] + "";
            }
            SupplierStrategyBuilder sb = new SupplierStrategyBuilder();

            if (IsEmpty == "1")
            {
                sb.AddStrategy(new Strategy(SupplierStrategyName.False));
            }

            if (SupplierName != "")
            {
                sb.AddStrategy(new Strategy(SupplierStrategyName.SupplierName, "%" + SupplierName + "%"));
            }

            if (Abbreviation != "")
            {
                sb.AddStrategy(new Strategy(SupplierStrategyName.Abbreviation, "%" + Abbreviation + "%"));
            }

            if (AreaCode != "")
            {
                sb.AddStrategy(new Strategy(SupplierStrategyName.AreaCode, "%" + AreaCode + "%"));
            }

            if (Quality != "")
            {
                sb.AddStrategy(new Strategy(SupplierStrategyName.Quality, "%" + Quality + "%"));
            }

            if (RegisteredAddress != "")
            {
                sb.AddStrategy(new Strategy(SupplierStrategyName.RegisteredAddress, "%" + RegisteredAddress + "%"));
            }

            if (ContractPerson != "")
            {
                sb.AddStrategy(new Strategy(SupplierStrategyName.ContractPerson, "%" + ContractPerson + "%"));
            }

            if (IndustryType != "")
            {
                sb.AddStrategy(new Strategy(SupplierStrategyName.IndustryType, "%" + IndustryType + "%"));
            }

            if (Achievement != "")
            {
                sb.AddStrategy(new Strategy(SupplierStrategyName.Achievement, "%" + Achievement + "%"));
            }

            if (CheckOpinion != "")
            {
                sb.AddStrategy(new Strategy(SupplierStrategyName.CheckOpinion, "%" + CheckOpinion + "%"));
            }

            if (chkSearch == "1" && (SupplierTypeCode != ""))
            {
                ArrayList arS = new ArrayList();
                arS.Add(SupplierTypeCode);
                arS.Add("0");
                sb.AddStrategy(new Strategy(SupplierStrategyName.SupplierTypeCodeEx, arS));
            }

            if (characterType != "")
            {
                sb.AddStrategy(new Strategy(SupplierStrategyName.CharacterType, "%" + characterType + "%"));
            }
            if (CreditLevel != "")
            {
                sb.AddStrategy(new Strategy(SupplierStrategyName.CreditLevel, "%" + CreditLevel + "%"));
            }

            if (IsExistsContract != "")
            {
                sb.AddStrategy(new Strategy(SupplierStrategyName.IsExistsContract, IsExistsContract));
            }


            if (SellForm != "")
            {
                sb.AddStrategy(new Strategy(SupplierStrategyName.SaleType, "%" + SellForm + "%"));
            }
            if (cccAttestation != "")
            {
                sb.AddStrategy(new Strategy(SupplierStrategyName.IsCCC, "%" + cccAttestation + "%"));
            }
            if (isoAttestation != "")
            {
                sb.AddStrategy(new Strategy(SupplierStrategyName.IsISO, "%" + isoAttestation + "%"));
            }
            if (QualityLevel != "")
            {
                sb.AddStrategy(new Strategy(SupplierStrategyName.QualityGrade, "%" + QualityLevel + "%"));
            }
            if (IsAuditted != "")
            {
                sb.AddStrategy(new Strategy(SupplierStrategyName.Status, IsAuditted));
            }
            ArrayList arA = new ArrayList();

            arA.Add("140101");
            arA.Add(user.UserCode);
            arA.Add(user.BuildStationCodes());
            sb.AddStrategy(new Strategy(SupplierStrategyName.AccessRange, arA));


            //排序
            string sortsql = BLL.GridSort.GetSortSQL(ViewState);

            string sql = sb.BuildMainQueryString();

            if (sortsql != "")
            {
                //点列标题排序
                sql = sql + " order by " + sortsql;
            }

            this.ViewState.Add("SqlString", sql);
        }
コード例 #4
0
ファイル: SelectSuplList.aspx.cs プロジェクト: riyuexing/rms
        private void LoadDataGrid(bool isEmpty)
        {
            try
            {
                DataTable tb;

                if (this.rbType.SelectedValue == "0")
                {
                    SalSuplStrategyBuilder sb = new SalSuplStrategyBuilder();

                    if (isEmpty)
                    {
                        sb.AddStrategy(new Strategy(SalSuplStrategyName.False));
                    }

                    string SuplName = this.txtSearchSuplName.Value.Trim();
                    if (SuplName != "")
                    {
                        sb.AddStrategy(new Strategy(SalSuplStrategyName.SuplName, SuplName));
                    }

                    sb.AddOrder("SuplName", true);

                    string sql = sb.BuildMainQueryString();

                    QueryAgent qa     = new QueryAgent();
                    EntityData entity = qa.FillEntityData("SalSupl", sql);
                    tb = entity.CurrentTable;
                    qa.Dispose();
                    entity.Dispose();
                }
                else
                {
                    SupplierStrategyBuilder sb = new SupplierStrategyBuilder();

                    if (isEmpty)
                    {
                        sb.AddStrategy(new Strategy(SupplierStrategyName.False));
                    }

                    string SuplName = this.txtSearchSuplName.Value.Trim();
                    if (SuplName != "")
                    {
                        sb.AddStrategy(new Strategy(SupplierStrategyName.SupplierName, SuplName));
                    }

                    sb.AddOrder("SupplierName", true);

                    string sql = sb.BuildMainQueryString();

                    QueryAgent qa     = new QueryAgent();
                    EntityData entity = qa.FillEntityData("Supplier", sql);
                    tb = entity.CurrentTable;
                    qa.Dispose();
                    entity.Dispose();
                }

                dgList.DataSource = tb;
                dgList.DataBind();
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "");
            }
        }