コード例 #1
0
        protected void UpdateCompanyInfo()
        {
            if (!IsCompanyCheck)//是否审核
            {
                Utils.ResponseMeg(false, "对不起,你尚未审核通过!");
                return;
            }
            string userAdmin = Utils.GetFormValue(cis_txtAdmin.UniqueID, 20);

            if (userAdmin == "")
            {
                Utils.ResponseMegNoComplete();
            }
            else
            {
                EyouSoft.Model.CompanyStructure.CompanyArchiveInfo companyArchModel = companyModel as EyouSoft.Model.CompanyStructure.CompanyArchiveInfo;
                //账户信息
                List <EyouSoft.Model.CompanyStructure.BankAccount> bankList = new List <EyouSoft.Model.CompanyStructure.BankAccount>();
                //获得公司账户
                EyouSoft.Model.CompanyStructure.BankAccount companyBankAccount = new EyouSoft.Model.CompanyStructure.BankAccount();
                companyBankAccount.BankAccountName = Utils.GetFormValue(cis_Company1.UniqueID, 100);        //账户名
                companyBankAccount.BankName        = Utils.GetFormValue(cis_CompanyBank1.UniqueID, 100);    //开户行
                companyBankAccount.AccountNumber   = Utils.GetFormValue(cis_CompanyAccount1.UniqueID, 100); //账号
                //判断公司账户是否全为空
                if (companyBankAccount.BankAccountName == "" && companyBankAccount.BankName == "" && companyBankAccount.AccountNumber == "")
                {
                }
                else
                {
                    if (companyBankAccount.BankAccountName == "" || companyBankAccount.BankName == "" || companyBankAccount.AccountNumber == "")
                    {
                        Utils.ResponseMeg(false, "请填写完整账户信息!");
                        return;
                    }
                    companyBankAccount.AccountType = EyouSoft.Model.CompanyStructure.BankAccountType.公司;
                    bankList.Add(companyBankAccount);
                }

                //获得个人账户集合
                var strNoList = Request.Form.AllKeys.Where(i => i.Contains("cis_PeosonName")).Select(i => i.Substring(14, i.Length - 14));
                foreach (string no in strNoList)
                {
                    EyouSoft.Model.CompanyStructure.BankAccount peosonBankModel = new EyouSoft.Model.CompanyStructure.BankAccount();
                    peosonBankModel.AccountNumber   = Utils.GetFormValue("cis_PeosonAccount" + no, 100); //账号
                    peosonBankModel.BankAccountName = Utils.GetFormValue("cis_PeosonName" + no, 100);    //账户名
                    peosonBankModel.BankName        = Utils.GetFormValue("cis_PeosonBank" + no, 100);    //开户行
                    //如果账户全为空则继续
                    if (peosonBankModel.AccountNumber == "" && peosonBankModel.BankAccountName == "" && peosonBankModel.BankName == "")
                    {
                        continue;
                    }
                    else
                    {   //如果不全为空但有空存在
                        if (peosonBankModel.AccountNumber == "" || peosonBankModel.BankAccountName == "" || peosonBankModel.BankName == "")
                        {
                            Utils.ResponseMeg(false, "请填写完整账户信息!");
                            return;
                        }
                        peosonBankModel.AccountType = EyouSoft.Model.CompanyStructure.BankAccountType.个人;
                    }

                    bankList.Add(peosonBankModel);
                }
                companyArchModel.BankAccounts            = bankList;
                companyArchModel.ContactInfo.ContactName = userAdmin;
                companyArchModel.CompanyBrand            = Utils.GetFormValue(this.txtBrandName.UniqueID, 50);
                companyArchModel.CompanyAddress          = Utils.GetFormValue(cis_txtCompanyAddress.UniqueID, 250);
                companyArchModel.Remark             = Utils.EditInputText(Request.Form["cis_CompanyDetail"]);
                companyArchModel.ContactInfo.Fax    = Utils.GetFormValue(cis_txtFax.UniqueID, 50);
                companyArchModel.ContactInfo.Mobile = Utils.GetFormValue(cis_txtMobile.UniqueID, 20);
                //companyArchModel.ContactInfo.MSN = Utils.GetFormValue(cis_txtMSN.UniqueID, 50);
                //companyArchModel.ContactInfo.QQ = Utils.GetFormValue(cis_txtQQ.UniqueID, 20);
                companyArchModel.ContactInfo.Tel = Utils.GetFormValue(cis_txtTel.UniqueID, 45);
                string logoPath = Utils.GetFormValue("ctl00$ContentPlaceHolder1$uc_logo_fileUp$hidFileName");
                if (logoPath != "")
                {
                    companyArchModel.AttachInfo.CompanyLogo.ImagePath = logoPath;
                }
                string cerPath = Utils.GetFormValue("ctl00$ContentPlaceHolder1$uc_Cert_fileUp$hidFileName");
                if (cerPath != "")
                {
                    companyArchModel.AttachInfo.BusinessCertif.BusinessCertImg = cerPath;
                }
                string licePath = Utils.GetFormValue("ctl00$ContentPlaceHolder1$uc_Licence_fileUp$hidFileName");
                if (licePath != "")
                {
                    companyArchModel.AttachInfo.BusinessCertif.LicenceImg = licePath;
                }
                string taxPath = Utils.GetFormValue("ctl00$ContentPlaceHolder1$uc_Tax_fileUp$hidFileName");
                if (taxPath != "")
                {
                    companyArchModel.AttachInfo.BusinessCertif.TaxRegImg = taxPath;
                }
                //string signPath = Utils.GetFormValue("ctl00$ContentPlaceHolder1$uc_Sign_fileUp$hidFileName");
                //if (signPath != "")
                //    companyArchModel.AttachInfo.CompanySignet = signPath;

                /*省市区不可修改  2012-02-10 信息来源:周
                 * //公司省市区
                 * companyArchModel.ProvinceId = Utils.GetInt(Utils.GetFormValue(this.ProvinceList.UniqueID),-1);
                 * companyArchModel.CityId = Utils.GetInt(Utils.GetFormValue(this.CityList.UniqueID), -1);
                 * companyArchModel.CountyId = Utils.GetInt(Utils.GetFormValue(this.CountyList.UniqueID), -1);
                 */
                //公司简称
                companyArchModel.Introduction = this.txtSimpleName.Value;
                //客服邮箱
                companyArchModel.ContactInfo.Email = this.txtEmail.Value;
                //同业联系方式
                companyArchModel.PeerContact = this.txtTongYeContact.Value;
                //支付宝账户
                companyArchModel.AlipayAccount = this.txtAliPay.Value.Trim();
                //签约时间
                companyArchModel.ContractStart = Utils.GetDateTimeNullable(this.txtStartTime.Value);
                companyArchModel.ContractEnd   = Utils.GetDateTimeNullable(this.txtEndTime.Value);
                //业务优势//只有运营后台可改
                //companyArchModel.ShortRemark = this.txtOperation.Value;
                //地图信息
                string[] strMap = this.hiddenMapXY.Value.Split(',');
                if (strMap.Length == 2)
                {
                    decimal x = 0;
                    decimal y = 0;
                    decimal.TryParse(strMap[0], out x);
                    decimal.TryParse(strMap[1], out y);
                    if (x != 0 && y != 0)
                    {
                        companyArchModel.Longitude = x;
                        companyArchModel.Latitude  = y;
                    }
                }
                //公司网址
                companyArchModel.WebSite = this.txtWebUrl.Value;
                //公司规模
                companyArchModel.Scale = (EyouSoft.Model.CompanyStructure.CompanyScale)Utils.GetInt(Utils.GetFormValue(this.ddlScale.UniqueID));
                //公司资质
                string[] qualiList = Utils.GetFormValues("cbxQualification");
                if (qualiList.Length > 0)
                {
                    for (int i = 0; i < qualiList.Length; i++)
                    {
                        companyArchModel.Qualification.Add((EyouSoft.Model.CompanyStructure.CompanyQualification)Utils.GetInt(qualiList[i]));
                    }
                }
                //公司县区
                int districtID = Utils.GetInt(Utils.GetFormValue("sltDistrictName"));
                companyArchModel.CountyId = districtID;
                //公司照片开始
                string companyPic1 = Utils.GetFormValue(this.CompanyPic1.UniqueID + "$hidFileName");
                string companyPic2 = Utils.GetFormValue(this.CompanyPic2.UniqueID + "$hidFileName");
                string companyPic3 = Utils.GetFormValue(this.CompanyPic3.UniqueID + "$hidFileName");
                List <EyouSoft.Model.CompanyStructure.CompanyPublicityPhoto> lstCompanyPic = new List <EyouSoft.Model.CompanyStructure.CompanyPublicityPhoto>();
                this.setComPicInfo(companyPic1, lstCompanyPic, 1);
                this.setComPicInfo(companyPic2, lstCompanyPic, 2);
                this.setComPicInfo(companyPic3, lstCompanyPic, 3);
                companyArchModel.AttachInfo.CompanyPublicityPhoto = lstCompanyPic;
                //公司照片结束
                //授权证书
                string rightPic = Utils.GetFormValue(this.setRightPic.UniqueID + "$hidFileName");
                if (!string.IsNullOrEmpty(rightPic))
                {
                    companyArchModel.AttachInfo.BusinessCertif.WarrantImg = rightPic;
                }
                //负责人身份证
                string idCardPic = Utils.GetFormValue(this.setIDCard.UniqueID + "$hidFileName");
                if (!string.IsNullOrEmpty(idCardPic))
                {
                    companyArchModel.AttachInfo.BusinessCertif.PersonCardImg = idCardPic;
                }
                if (companyBll.UpdateSelf(companyArchModel))//执行修改
                {
                    Utils.ResponseMegSuccess();
                }
                else
                {
                    Utils.ResponseMegError();
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// 更新公司信息
        /// </summary>
        /// <param name="requestInfo"></param>
        /// <returns></returns>
        private EyouSoft.OpenRelation.Model.MResponseInfo UpdateCompanyInfo(EyouSoft.OpenRelation.Model.MRequestInfo requestInfo)
        {
            EyouSoft.OpenRelation.Model.MResponseInfo responseInfo = new EyouSoft.OpenRelation.Model.MResponseInfo()
            {
                IsSuccess = true
            };
            if (requestInfo == null)
            {
                responseInfo.IsSuccess = false;
                responseInfo.Desc      = "http request post info对象为空!";

                return(responseInfo);
            }

            EyouSoft.OpenRelation.Model.MCompanyInfo MiddComp = EyouSoft.OpenRelation.Utils.InvertJSON <EyouSoft.OpenRelation.Model.MCompanyInfo>(requestInfo.InstructionCode);
            if (MiddComp == null)
            {
                responseInfo.IsSuccess = false;
                responseInfo.Desc      = "Josn对象转为中间平台对象时发生错误!";

                return(responseInfo);
            }
            EyouSoft.IBLL.CompanyStructure.ICompanyInfo        ComBll      = EyouSoft.BLL.CompanyStructure.CompanyInfo.CreateInstance();
            EyouSoft.Model.CompanyStructure.CompanyArchiveInfo CompanyInfo = ComBll.GetModel(MiddComp.PlatformCompanyId);
            if (CompanyInfo == null || CompanyInfo.ContactInfo == null)
            {
                responseInfo.IsSuccess = false;
                responseInfo.Desc      = "在平台中未找到对应的公司或者公司对应的联系人信息!";

                return(responseInfo);
            }

            //大平台邮箱不能为空 赋值空格
            if (string.IsNullOrEmpty(MiddComp.ContactEmail))
            {
                MiddComp.ContactEmail = " ";
            }

            //公司
            if (!string.IsNullOrEmpty(MiddComp.CompanyName))
            {
                CompanyInfo.CompanyName = MiddComp.CompanyName;
            }
            if (!string.IsNullOrEmpty(MiddComp.Address))
            {
                CompanyInfo.CompanyAddress = MiddComp.Address;
            }
            if (!string.IsNullOrEmpty(MiddComp.Domain))
            {
                CompanyInfo.WebSite = MiddComp.Domain;
            }
            //联系人
            if (!string.IsNullOrEmpty(MiddComp.ContactName))
            {
                CompanyInfo.ContactInfo.ContactName = MiddComp.ContactName;
            }
            if (!string.IsNullOrEmpty(MiddComp.ContactTelephone))
            {
                CompanyInfo.ContactInfo.Tel = MiddComp.ContactTelephone;
            }
            if (!string.IsNullOrEmpty(MiddComp.ContactMobile))
            {
                CompanyInfo.ContactInfo.Mobile = MiddComp.ContactMobile;
            }
            if (!string.IsNullOrEmpty(MiddComp.ContactFax))
            {
                CompanyInfo.ContactInfo.Fax = MiddComp.ContactFax;
            }
            CompanyInfo.ContactInfo.Email      = MiddComp.ContactEmail;
            CompanyInfo.ContactInfo.MSN        = MiddComp.ContactMSN;
            CompanyInfo.ContactInfo.QQ         = MiddComp.ContactQQ;
            CompanyInfo.ContactInfo.ContactSex = GetGender(MiddComp.ContactGender);

            try
            {
                responseInfo.IsSuccess = ComBll.UpdateSelf(CompanyInfo);
                responseInfo.Desc      = "修改公司信息完成!";
            }
            catch (Exception e)
            {
                responseInfo.IsSuccess = false;
                responseInfo.Desc      = "修改公司信息操作执行异常!";
                responseInfo.ErrorCode = e.Message + e.StackTrace;
            }

            return(responseInfo);
        }