예제 #1
0
        /// <summary>
        /// 获得银行帐号信息
        /// </summary>
        /// <param name="companyId">公司ID</param>
        /// <returns></returns>
        public virtual IList <EyouSoft.Model.CompanyStructure.BankAccount> GetList(string companyId)
        {
            IList <EyouSoft.Model.CompanyStructure.BankAccount> items = new List <EyouSoft.Model.CompanyStructure.BankAccount>();
            DbCommand dc = this._database.GetSqlStringCommand(SQL_BankAccount_SELECT);

            this._database.AddInParameter(dc, "companyId", DbType.AnsiStringFixedLength, companyId);
            using (IDataReader rdr = DbHelper.ExecuteReader(dc, this._database))
            {
                while (rdr.Read())
                {
                    EyouSoft.Model.CompanyStructure.BankAccount item = new EyouSoft.Model.CompanyStructure.BankAccount();
                    item.AccountNumber   = rdr.IsDBNull(rdr.GetOrdinal("AccountNumber")) == true ? "" : rdr.GetString(rdr.GetOrdinal("AccountNumber"));
                    item.AccountType     = (EyouSoft.Model.CompanyStructure.BankAccountType)rdr.GetByte(rdr.GetOrdinal("TypeId"));
                    item.BankAccountName = rdr.IsDBNull(rdr.GetOrdinal("BankAccountName")) == true ? "" : rdr.GetString(rdr.GetOrdinal("BankAccountName"));
                    item.BankName        = rdr.IsDBNull(rdr.GetOrdinal("BankName")) == true ? "" : rdr.GetString(rdr.GetOrdinal("BankName"));
                    item.CompanyID       = rdr.GetString(rdr.GetOrdinal("CompanyId"));
                    items.Add(item);
                }
            }

            return(items);
        }
예제 #2
0
        protected void LoadCompanyInfo()
        {
            if (companyModel != null)
            {
                haveArea = companyModel.CompanyRole.HasRole(EyouSoft.Model.CompanyStructure.CompanyType.专线);
                EyouSoft.Model.SystemStructure.SysProvince proviceModel = EyouSoft.BLL.SystemStructure.SysProvince.CreateInstance().GetProvinceModel(companyModel.ProvinceId);
                EyouSoft.Model.SystemStructure.SysCity     cityModel    = EyouSoft.BLL.SystemStructure.SysCity.CreateInstance().GetSysCityModel(companyModel.CityId);

                EyouSoft.IBLL.SystemStructure.ISysDistrictCounty disBll      = EyouSoft.BLL.SystemStructure.SysDistrictCounty.CreateInstance();
                EyouSoft.Model.SystemStructure.SysDistrictCounty countyModel = disBll.GetModel(companyModel.CountyId);
                if (proviceModel != null)
                {
                    cityName = proviceModel.ProvinceName;
                }
                if (cityModel != null)
                {
                    cityName += "-" + cityModel.CityName;
                }
                if (countyModel != null)
                {
                    if (countyModel.DistrictName.Trim() != "")
                    {
                        cityName += "-" + countyModel.DistrictName;
                    }
                }
                else
                {
                    string districtName = "";
                    IList <EyouSoft.Model.SystemStructure.SysDistrictCounty> disList = disBll.GetDistrictCounty(companyModel.CityId);
                    if (disList != null && disList.Count > 0)
                    {
                        for (int i = 0; i < disList.Count; i++)
                        {
                            districtName += "<option value='" + disList[i].Id.ToString() + "'>" + disList[i].DistrictName + "</option>";
                        }
                    }
                    cityName += "-&nbsp;<select name='sltDistrictName'>" + districtName + "</select>";
                }

                if (companyModel.SaleCity != null)
                {
                    foreach (EyouSoft.Model.SystemStructure.CityBase city in companyModel.SaleCity)
                    {
                        saleCityName += city.CityName + ",";
                    }
                    saleCityName = saleCityName.TrimEnd(',');
                }
                companyName                 = companyModel.CompanyName;
                licenese                    = string.IsNullOrEmpty(companyModel.License) ? "暂无" : companyModel.License;
                cis_txtAdmin.Value          = companyModel.ContactInfo.ContactName;
                this.txtBrandName.Value     = companyModel.CompanyBrand;
                cis_txtCompanyAddress.Value = companyModel.CompanyAddress;
                companyDetail               = companyModel.Remark;
                cis_txtFax.Value            = companyModel.ContactInfo.Fax;
                cis_txtMobile.Value         = companyModel.ContactInfo.Mobile;
                //cis_txtMSN.Value = companyModel.ContactInfo.MSN;
                //cis_txtQQ.Value = companyModel.ContactInfo.QQ;
                cis_txtTel.Value = companyModel.ContactInfo.Tel;
                //初始化账户信息
                List <EyouSoft.Model.CompanyStructure.BankAccount> BankAccountList = companyModel.BankAccounts;
                if (BankAccountList != null)
                {
                    if (BankAccountList.Where(i => i.AccountType == EyouSoft.Model.CompanyStructure.BankAccountType.公司).Count() > 0)
                    {
                        EyouSoft.Model.CompanyStructure.BankAccount companyBankAccount = BankAccountList.Where(i => i.AccountType == EyouSoft.Model.CompanyStructure.BankAccountType.公司).First();
                        cis_Company1.Value        = companyBankAccount.BankAccountName;
                        cis_CompanyAccount1.Value = companyBankAccount.AccountNumber;
                        cis_CompanyBank1.Value    = companyBankAccount.BankName;
                    }
                    cis_rpt_personBank.DataSource = companyModel.BankAccounts.Where(i => i.AccountType == EyouSoft.Model.CompanyStructure.BankAccountType.个人);
                    cis_rpt_personBank.DataBind();
                }
                //地区,省、市、区
                //this.ClientScript.RegisterStartupScript(this.GetType(), Guid.NewGuid().ToString(), string.Format("CompanyInfoSet.InitPlace('{0}','{1}','{2}');",companyModel.ProvinceId,companyModel.CityId,companyModel.CountyId), true);
                this.spanProvinceInfo.InnerHtml = cityName;// string.Format("{0}&nbsp;&nbsp;{1}&nbsp;&nbsp;{2}", proviceModel.ProvinceName, cityModel.CityName, countyModel.DistrictName);
                //管理员账户
                this.txtAdminCode.Value = companyModel.AdminAccount.UserName;
                //同业联系方式
                this.txtTongYeContact.Value = companyModel.PeerContact;
                //销售城市
                StringBuilder strSaleCity = new StringBuilder();
                List <EyouSoft.Model.SystemStructure.CityBase> lstSaleCity = companyModel.SaleCity;
                if (null != lstSaleCity && lstSaleCity.Count > 0)
                {
                    for (int i = 0; i < lstSaleCity.Count; i++)
                    {
                        strSaleCity.Append(lstSaleCity[i].CityName + ";");
                    }
                }
                this.txtSaleCity.InnerHtml = strSaleCity.Length > 0 ? strSaleCity.ToString() : "暂无销售城市";
                //公司简称
                this.txtSimpleName.Value = companyModel.Introduction;
                //客服邮箱
                this.txtEmail.Value         = companyModel.ContactInfo.Email;
                this.ddlScale.SelectedValue = Convert.ToString((int)companyModel.Scale);
                //string strUrl = "<a href=\"" + Domain.FileSystem + "{0}\" target='_blank' style='color:#f00;'>查看</a><a href=\"javascript:void(0);\" onclick=\"CompanyInfoSet.delFile(this)\" title='删除'><img src=\"" + ImageServerUrl + "/images/fujian_x.gif\"/></a>";
                string strUrl = "<a href=\"" + Domain.FileSystem + "{0}\" target='_blank'>查看</a>";
                //支付宝账户
                this.txtAliPay.Value = companyModel.AlipayAccount;
                //用户等级
                this.spanUserLevel.InnerHtml = Convert.ToString(companyModel.CompanyLev);
                //资料完整度
                this.spanInfoLevel.InnerHtml = (int)(companyModel.InfoFull * 100) + "%";
                //签约时间
                this.txtStartTime.Value = string.Format("{0:yyyy-MM-dd}", companyModel.ContractStart);
                this.txtEndTime.Value   = string.Format("{0:yyyy-MM-dd}", companyModel.ContractEnd);
                //业务优势
                this.txtOperation.Value = companyModel.ShortRemark;
                //公司网址
                this.txtWebUrl.Value = companyModel.WebSite;
                //公司经纬度
                if (companyModel.Longitude == 0 && companyModel.Latitude == 0)
                {
                    this.spanMapXY.InnerHtml = "<font style='color:#f00;font-size:12px;'>暂未设置地理位置!</font>";
                }
                else
                {
                    this.hiddenMapXY.Value = companyModel.Longitude + "," + companyModel.Latitude;
                }
                //公司图片开始
                IList <EyouSoft.Model.CompanyStructure.CompanyPublicityPhoto> lstCompanyPic = companyModel.AttachInfo.CompanyPublicityPhoto;
                if (null != lstCompanyPic && lstCompanyPic.Count > 0)
                {
                    for (int i = 0; i < lstCompanyPic.Count; i++)
                    {
                        switch (i)
                        {
                        case 0:
                            this.LtComPic1.Text = string.IsNullOrEmpty(lstCompanyPic[i].ImagePath.Trim()) ? "暂无图片" : string.Format(strUrl, lstCompanyPic[i].ImagePath);
                            MessageBox.ResponseScript(this, string.Format("CompanyInfoSet.setCompPic(0,'{0}');", lstCompanyPic[i].ImagePath));
                            break;

                        case 1:
                            this.LtComPic2.Text = string.IsNullOrEmpty(lstCompanyPic[i].ImagePath.Trim()) ? "暂无图片" : string.Format(strUrl, lstCompanyPic[i].ImagePath);
                            MessageBox.ResponseScript(this, string.Format("CompanyInfoSet.setCompPic(1,'{0}');", lstCompanyPic[i].ImagePath));
                            break;

                        case 2:
                            this.LtComPic3.Text = string.IsNullOrEmpty(lstCompanyPic[i].ImagePath.Trim()) ? "暂无图片" : string.Format(strUrl, lstCompanyPic[i].ImagePath);
                            MessageBox.ResponseScript(this, string.Format("CompanyInfoSet.setCompPic(2,'{0}');", lstCompanyPic[i].ImagePath));
                            break;

                        default:
                            break;
                        }
                    }
                }
                //公司图片结束
                //授权证书//负责人身份证
                this.spanSetRightPic.InnerHtml = string.IsNullOrEmpty(companyModel.AttachInfo.BusinessCertif.WarrantImg) ? "暂无授权证书图片" : string.Format(strUrl, companyModel.AttachInfo.BusinessCertif.WarrantImg);
                this.spanSetIDCard.InnerHtml   = string.IsNullOrEmpty(companyModel.AttachInfo.BusinessCertif.PersonCardImg) ? "暂无负责人身份证图片" : string.Format(strUrl, companyModel.AttachInfo.BusinessCertif.PersonCardImg);
                MessageBox.ResponseScript(this, string.Format("CompanyInfoSet.setRightPicAndIDCard(0,'{0}');CompanyInfoSet.setRightPicAndIDCard(1,'{1}');", companyModel.AttachInfo.BusinessCertif.WarrantImg, companyModel.AttachInfo.BusinessCertif.PersonCardImg));
                //旅行社资质
                IList <EyouSoft.Model.CompanyStructure.CompanyQualification> lstCompetence = companyModel.Qualification;
                StringBuilder strCompetence = new StringBuilder();
                if (null != lstCompetence && lstCompetence.Count > 0)
                {
                    for (int i = 0; i < lstCompetence.Count; i++)
                    {
                        strCompetence.Append(lstCompetence[i] + ";");
                    }
                }
                if (strCompetence.Length == 0)
                {
                    IList <EyouSoft.Common.EnumObj> enQualification = EyouSoft.Common.EnumObj.GetList(typeof(EyouSoft.Model.CompanyStructure.CompanyQualification));
                    if (enQualification != null && enQualification.Count > 0)
                    {
                        for (int i = 0; i < enQualification.Count; i++)
                        {
                            strCompetence.Append("<input type='checkbox' name='cbxQualification'  value='" + enQualification[i].Value + "' />" + enQualification[i].Text + "&nbsp;&nbsp;");
                        }
                    }
                }
                this.spanCompetence.InnerHtml = strCompetence.ToString();
                //经营区域
                StringBuilder strArea = new StringBuilder();
                List <EyouSoft.Model.SystemStructure.AreaBase> areaList = companyModel.Area;
                if (null != areaList && areaList.Count > 0)
                {
                    for (int i = 0; i < areaList.Count; i++)
                    {
                        strArea.AppendFormat("{0}&nbsp;&nbsp;", areaList[i].AreaName);
                    }
                }
                if (strArea.Length > 0)
                {
                    this.trAreas.Visible     = true;
                    this.spanAreas.InnerHtml = strArea.ToString();
                }
                else
                {
                    this.trAreas.Visible = false;
                }
            }
            //加载经营范围
            if (haveArea)
            {
                IList <EyouSoft.Model.SystemStructure.AreaBase> areaList = EyouSoft.BLL.CompanyStructure.CompanyArea.CreateInstance().GetCompanyArea(SiteUserInfo.CompanyID);
                if (areaList != null && areaList.Count > 0)
                {
                    IList <EyouSoft.Model.SystemStructure.AreaBase> longAreaList = areaList.Where(i => i.RouteType == EyouSoft.Model.SystemStructure.AreaType.国内长线).ToList <EyouSoft.Model.SystemStructure.AreaBase>();
                    longCount = longAreaList.Count;
                    pis_rpt_LongAreaList.DataSource = longAreaList;
                    pis_rpt_LongAreaList.DataBind();
                    IList <EyouSoft.Model.SystemStructure.AreaBase> shortAreaList = areaList.Where(i => i.RouteType == EyouSoft.Model.SystemStructure.AreaType.国内短线).ToList <EyouSoft.Model.SystemStructure.AreaBase>();
                    shortCount = shortAreaList.Count;
                    pis_rpt_ShortAreaList.DataSource = shortAreaList;
                    pis_rpt_ShortAreaList.DataBind();
                    IList <EyouSoft.Model.SystemStructure.AreaBase> exitAreaList = areaList.Where(i => i.RouteType == EyouSoft.Model.SystemStructure.AreaType.国际线).ToList <EyouSoft.Model.SystemStructure.AreaBase>();
                    exitCount = exitAreaList.Count;
                    pis_rpt_ExitAreaList.DataSource = exitAreaList;
                    pis_rpt_ExitAreaList.DataBind();
                }
            }
        }
예제 #3
0
        /// <summary>
        /// 修改公司信息
        /// </summary>
        protected void btnSave_Click(object sender, EventArgs e)
        {
            //省份ID
            int ProvinceId = EyouSoft.Common.Utils.GetInt(Request.Form["dropProvinceId"]);
            //城市ID
            int CityId = EyouSoft.Common.Utils.GetInt(Request.Form["dropCityId"]);
            //县区ID
            int CountyId = EyouSoft.Common.Utils.GetInt(Request.Form["dropCountyId"]);
            //公司名称
            string txtCompanyName = Utils.InputText(this.txtCompanyName.Value.Trim());
            //许可证号
            string txtLicenseNumber = Utils.InputText(this.txtLicenseNumber.Value.Trim());
            //名牌名称
            string txtBrandName = Utils.InputText(this.txtBrandName.Value.Trim());
            //用户名
            string txtUserName = Utils.InputText(this.txtUserName.Value.Trim());
            //密码
            string NewPassWord = "";

            if (!string.IsNullOrEmpty(this.txtPassWord.Value.Trim()))
            {
                NewPassWord = Utils.InputText(this.txtPassWord.Value.Trim());
            }
            //联系人名称
            string txtContactName = Utils.InputText(this.txtContactName.Value.Trim());

            //联系电话
            string txtContactTel = Utils.InputText(this.txtContactTel.Value.Trim());
            //联系手机
            string txtContactMobile = Utils.InputText(this.txtContactMobile.Value.Trim());
            //传真
            string txtContactFax = Utils.InputText(this.txtContactFax.Value.Trim());
            //办公地点
            string txtOfficeAddress = Utils.InputText(this.txtOfficeAddress.Value.Trim());
            //MQ
            string txtContactQQ = Utils.InputText(this.txtContactQQ.Value.Trim(), 100);
            //MSN
            string txtContactMSN = Utils.InputText(this.txtContactMSN.Value.Trim());
            //Email
            string txtContactEmail = Utils.InputText(this.txtContactEmail.Value.Trim());
            //经营范围
            string CompanyType = Utils.InputText(Request.Form["radManageArea"]);

            if (CompanyType == "")
            {
                //旅行社
                CompanyType = Utils.InputText(Request.Form["ckCompanyType"]);

                //专线商时有销售城市及经营线路区域
            }
            //公司介绍
            string txtCompanyInfo = Utils.EditInputText(this.txtCompanyInfo.Value.Trim());
            //业务优势
            string txtBusinessSuperior = Utils.InputText(this.txtBusinessSuperior.Value.Trim());

            #region  公司银行账户
            string txtCompanyBackName   = Utils.InputText(this.txtCompanyBackName.Value.Trim());
            string txtCompanyBack       = Utils.InputText(this.txtCompanyBack.Value.Trim());
            string txtCompanyBackNumber = Utils.InputText(this.txtCompanyBackNumber.Value.Trim());
            #endregion

            #region 个人银行账户
            string[] txtBankAccountName = Request.Form.GetValues("txtBankAccountName");
            string[] txtBankName        = Request.Form.GetValues("txtBankName");
            string[] txtAccountNumber   = Request.Form.GetValues("txtAccountNumber");
            #endregion

            EyouSoft.Model.CompanyStructure.CompanyArchiveInfo model = new EyouSoft.Model.CompanyStructure.CompanyArchiveInfo();

            /*公司信息*/
            model.ID             = EditId;
            model.CompanyName    = txtCompanyName;
            model.ProvinceId     = ProvinceId;
            model.CityId         = CityId;
            model.CountyId       = CountyId;
            model.CompanyAddress = txtOfficeAddress;
            model.CompanyBrand   = txtBrandName;
            model.License        = txtLicenseNumber;
            model.Remark         = txtCompanyInfo;
            model.ShortRemark    = txtBusinessSuperior;

            /*证书管理 */

            EyouSoft.Model.CompanyStructure.CompanyAttachInfo AttachInfo = new EyouSoft.Model.CompanyStructure.CompanyAttachInfo();
            EyouSoft.Model.CompanyStructure.BusinessCertif    Buiness    = new EyouSoft.Model.CompanyStructure.BusinessCertif();
            string LicenceImg = Request.Form["SingleFilelLicence$hidFileName"];
            if (string.IsNullOrEmpty(LicenceImg) && this.hidOldLicenceImg.Value != "")
            {
                LicenceImg = this.hidOldLicenceImg.Value;
            }
            string BusinessCertImg = Request.Form["SingleFileBusinessCertImg$hidFileName"];
            if (string.IsNullOrEmpty(BusinessCertImg) && this.hidOldBusinessCertImg.Value != "")
            {
                BusinessCertImg = this.hidOldBusinessCertImg.Value;
            }
            string TaxRegImg = Request.Form["SingleFileTaxRegImg$hidFileName"];
            if (string.IsNullOrEmpty(TaxRegImg) && this.hidOldTaxRegImg.Value != "")
            {
                TaxRegImg = this.hidOldTaxRegImg.Value;
            }
            Buiness.LicenceImg      = LicenceImg;
            Buiness.BusinessCertImg = BusinessCertImg;
            Buiness.TaxRegImg       = TaxRegImg;

            AttachInfo.BusinessCertif = Buiness;
            Buiness = null;

            model.AttachInfo = AttachInfo;
            AttachInfo       = null;


            EyouSoft.Model.CompanyStructure.UserAccount UserModel = new EyouSoft.Model.CompanyStructure.UserAccount();
            #region 用户信息
            /*用户信息*/
            UserModel.UserName = txtUserName;
            UserModel.PassWordInfo.NoEncryptPassword = NewPassWord;
            #endregion
            model.AdminAccount = UserModel;
            UserModel          = null;

            EyouSoft.Model.CompanyStructure.ContactPersonInfo ContactModel = new EyouSoft.Model.CompanyStructure.ContactPersonInfo();
            #region 公司联系人信息
            /* 公司联系人信息 */
            ContactModel.ContactName = txtContactName;
            ContactModel.Tel         = txtContactTel;
            ContactModel.Mobile      = txtContactMobile;
            ContactModel.Fax         = txtContactFax;
            ContactModel.QQ          = txtContactQQ;
            ContactModel.MSN         = txtContactMSN;
            ContactModel.Email       = txtContactEmail;
            #endregion
            model.ContactInfo = ContactModel;
            ContactModel      = null;

            #region 公司身份
            /* 公司身份 */
            EyouSoft.Model.CompanyStructure.CompanyRole RoleMode = new EyouSoft.Model.CompanyStructure.CompanyRole();
            EyouSoft.Model.CompanyStructure.CompanyType TypeEmnu = EyouSoft.Model.CompanyStructure.CompanyType.全部;
            //旅行社
            if (CompanyType == "0")
            {
                string[] strType = Request.Form.GetValues("ckCompanyType");
                for (int i = 0; i < strType.Length; i++)
                {
                    if (strType[i] == "1")
                    {
                        TypeEmnu = EyouSoft.Model.CompanyStructure.CompanyType.专线;

                        string[] strSalelist = Request.Form.GetValues("ckSellCity");
                        if (strSalelist != null)
                        {
                            //设置销售城市
                            List <EyouSoft.Model.SystemStructure.CityBase> SaleCity = new List <EyouSoft.Model.SystemStructure.CityBase>();
                            for (int j = 0; j < strSalelist.Length; j++)
                            {
                                EyouSoft.Model.SystemStructure.CityBase item = new EyouSoft.Model.SystemStructure.CityBase();
                                item.ProvinceId = ProvinceId;
                                item.CityId     = EyouSoft.Common.Function.StringValidate.GetIntValue(strSalelist[j]);
                                SaleCity.Add(item);
                                item = null;
                            }
                            model.SaleCity = SaleCity;
                            SaleCity       = null;
                        }
                        //设置经营线路区域
                        string[] strAreaList = Request.Form.GetValues("checkbox_Area");

                        if (strAreaList != null)
                        {
                            List <EyouSoft.Model.SystemStructure.AreaBase> AreaList = new List <EyouSoft.Model.SystemStructure.AreaBase>();
                            for (int j = 0; j < strAreaList.Length; j++)
                            {
                                EyouSoft.Model.SystemStructure.AreaBase item = new EyouSoft.Model.SystemStructure.AreaBase();
                                item.AreaId = Convert.ToInt32(strAreaList[j]);
                                AreaList.Add(item);
                                item = null;
                            }
                            model.Area = AreaList;
                            AreaList   = null;
                        }
                    }
                    if (strType[i] == "2")
                    {
                        TypeEmnu = EyouSoft.Model.CompanyStructure.CompanyType.组团;
                    }
                    if (strType[i] == "3")
                    {
                        TypeEmnu = EyouSoft.Model.CompanyStructure.CompanyType.地接;
                    }
                    RoleMode.SetRole(TypeEmnu);
                }
            }
            else
            {
                switch (CompanyType)
                {
                case "4":
                    TypeEmnu = EyouSoft.Model.CompanyStructure.CompanyType.景区;
                    break;

                case "5":
                    TypeEmnu = EyouSoft.Model.CompanyStructure.CompanyType.酒店;
                    break;

                case "6":
                    TypeEmnu = EyouSoft.Model.CompanyStructure.CompanyType.车队;
                    break;

                case "7":
                    TypeEmnu = EyouSoft.Model.CompanyStructure.CompanyType.旅游用品店;
                    break;

                case "8":
                    TypeEmnu = EyouSoft.Model.CompanyStructure.CompanyType.购物店;
                    break;

                case "9":
                    TypeEmnu = EyouSoft.Model.CompanyStructure.CompanyType.机票供应商;
                    break;

                case "10":
                    TypeEmnu = EyouSoft.Model.CompanyStructure.CompanyType.其他采购商;
                    break;

                case "11":
                    TypeEmnu = EyouSoft.Model.CompanyStructure.CompanyType.随便逛逛;
                    break;
                }
                RoleMode.SetRole(TypeEmnu);
            }
            #endregion
            model.CompanyRole = RoleMode;
            RoleMode          = null;

            List <EyouSoft.Model.CompanyStructure.BankAccount> BankList = new List <EyouSoft.Model.CompanyStructure.BankAccount>();
            #region 银行账号
            /* 公司银行账户信息 */
            EyouSoft.Model.CompanyStructure.BankAccount BankCompanyModel = new EyouSoft.Model.CompanyStructure.BankAccount();
            BankCompanyModel.AccountType     = EyouSoft.Model.CompanyStructure.BankAccountType.公司;
            BankCompanyModel.BankAccountName = txtCompanyBackName;
            BankCompanyModel.BankName        = txtCompanyBack;
            BankCompanyModel.AccountNumber   = txtCompanyBackNumber;
            BankCompanyModel.CompanyID       = EditId;
            BankList.Add(BankCompanyModel);
            BankCompanyModel = null;
            if (!string.IsNullOrEmpty(txtBankAccountName.ToString()))
            {
                /* 个人银行帐户信息 */
                for (int i = 0; i < txtBankAccountName.Length; i++)
                {
                    if (!string.IsNullOrEmpty(txtBankAccountName[i]))
                    {
                        EyouSoft.Model.CompanyStructure.BankAccount BankModel = new EyouSoft.Model.CompanyStructure.BankAccount();
                        BankModel.AccountType     = EyouSoft.Model.CompanyStructure.BankAccountType.个人;
                        BankModel.BankAccountName = txtBankAccountName[i];
                        BankModel.BankName        = txtBankName[i];
                        BankModel.AccountNumber   = txtAccountNumber[i];
                        BankModel.CompanyID       = EditId;
                        BankList.Add(BankModel);
                        BankModel = null;
                    }
                }
            }
            #endregion
            model.BankAccounts = BankList;
            BankList           = null;

            bool Result = EyouSoft.BLL.CompanyStructure.CompanyInfo.CreateInstance().Update(model);
            if (Result)
            {
                if (EyouSoft.Common.Utils.GetQueryStringValue("type") == "list")
                {
                    Response.Write("<script language='javascript'>alert('修改成功!');parent.Boxy.getIframeDialog('" + Request.QueryString["iframeid"] + "').hide();</script>");
                }
                else
                {
                    EyouSoft.Common.Function.MessageBox.ShowAndRedirect(this.Page, "修改成功!", returnUrl);
                }
            }
            else
            {
                EyouSoft.Common.Function.MessageBox.Show(this.Page, "修改失败!");
            }
            model = null;
        }
예제 #4
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();
                }
            }
        }
예제 #5
0
        /// <summary>
        /// 初始化
        /// </summary>
        private void InitPage(bool isShow)
        {
            #region 根据订单号获取相关信息
            //EyouSoft.Model.TourStructure.TourOrder
            EyouSoft.IBLL.TourStructure.ITourOrder IOrderbll  = EyouSoft.BLL.TourStructure.TourOrder.CreateInstance();
            EyouSoft.Model.TourStructure.TourOrder OrderModel = IOrderbll.GetOrderModel(OrderID);
            if (OrderModel != null)
            {
                BuyCompanyID  = OrderModel.BuyCompanyID;
                SellCompanyID = OrderModel.CompanyID;
                RouteName     = OrderModel.RouteName;

                if (!string.IsNullOrEmpty(OrderModel.LeaveTraffic))
                {
                    ltrTraffic.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(OrderModel.LeaveTraffic);
                }
                else
                {
                    Tr_Traffic.Visible = false;
                }

                ComfirmTime        = DateTime.Now.ToShortDateString();
                AdultPrice         = OrderModel.PersonalPrice.ToString("F2");
                this.ChildrenPrice = OrderModel.ChildPrice.ToString("F2");
                SumPrice           = OrderModel.SumPrice.ToString("F2");
                AdultNum           = OrderModel.AdultNumber;
                ChildrenNum        = OrderModel.ChildNumber;
            }
            else
            {
                return;
            }
            #endregion

            #region 游客信息
            if (OrderModel.TourOrderCustomer != null && OrderModel.TourOrderCustomer.Count > 0)
            {
                IList <EyouSoft.Model.TourStructure.TourOrderCustomer> OrderCustomerList = OrderModel.TourOrderCustomer;
                this.rptCustomers.DataSource = OrderCustomerList;
                this.rptCustomers.DataBind();
                if (rptCustomers.Items.Count < 1)
                {
                    this.tblCustomers.Visible = false;
                }
            }
            #endregion

            #region 专线公司信息
            EyouSoft.Model.CompanyStructure.CompanyInfo SellCompany = new EyouSoft.Model.CompanyStructure.CompanyInfo();
            SellCompany = this.GetCompanyInfo(SellCompanyID);
            if (SellCompany != null)
            {
                txtSellCompanyName.Value = SellCompany.CompanyName;
                txtSellConnectName.Value = SellCompany.ContactInfo.ContactName;
                txtSellConnectFax.Value  = SellCompany.ContactInfo.Fax;
                txtSellConnectTel.Value  = SellCompany.ContactInfo.Tel;
            }
            #endregion

            #region 组团公司信息
            EyouSoft.Model.CompanyStructure.CompanyInfo BuyCompany = new EyouSoft.Model.CompanyStructure.CompanyInfo();
            BuyCompany = this.GetCompanyInfo(BuyCompanyID);
            if (BuyCompany != null)
            {
                txtBuyCompanyName.Value = BuyCompany.CompanyName;
                txtBuyConnectName.Value = BuyCompany.ContactInfo.ContactName;
                txtBuyConnectFax.Value  = BuyCompany.ContactInfo.Fax;
                txtBuyConnectTel.Value  = BuyCompany.ContactInfo.Tel;
            }
            #endregion

            if (this.IsLogin)
            {
                CompanyID = this.SiteUserInfo.CompanyID;
                ltrSellCompanyName.Text = this.SiteUserInfo.CompanyName;
            }

            #region 银行帐号信息
            EyouSoft.IBLL.CompanyStructure.IBankAccount         IbankBll = EyouSoft.BLL.CompanyStructure.BankAccount.CreateInstance();
            IList <EyouSoft.Model.CompanyStructure.BankAccount> bankList = IbankBll.GetList(SellCompanyID);
            if (bankList != null && bankList.Count > 0)
            {
                EyouSoft.Model.CompanyStructure.BankAccount CompanyBankAccount = bankList.FirstOrDefault(BankItem =>
                {
                    return(BankItem.AccountType == EyouSoft.Model.CompanyStructure.BankAccountType.公司);
                });
                if (CompanyBankAccount != null)
                {
                    ltrSellCompanyName.Text    = CompanyBankAccount.BankAccountName;
                    ltrBuyComapnyBankName.Text = CompanyBankAccount.BankName;
                    ltrBuyComapnyBankNo.Text   = CompanyBankAccount.AccountNumber;
                }

                rptBankAccount.DataSource = ((List <EyouSoft.Model.CompanyStructure.BankAccount>)bankList).FindAll(BankItem =>
                {
                    return(BankItem.AccountType == EyouSoft.Model.CompanyStructure.BankAccountType.个人);
                });
                rptBankAccount.DataBind();
                IbankBll           = null;
                bankList           = null;
                CompanyBankAccount = null;
            }
            #endregion

            #region 团队信息
            EyouSoft.IBLL.TourStructure.ITour     Ibll  = EyouSoft.BLL.TourStructure.Tour.CreateInstance();
            EyouSoft.Model.TourStructure.TourInfo model = Ibll.GetTourInfo(TourID);
            if (model != null)
            {
                RouteName = model.RouteName;
                TourDays  = model.TourDays;
                LeaveDate = model.LeaveDate;
                if (model.ReleaseType == EyouSoft.Model.TourStructure.ReleaseType.Standard)//标准发布
                {
                    if (!string.IsNullOrEmpty(model.MeetTourContect))
                    {
                        ltrMeetTourContect.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(model.MeetTourContect);
                    }
                    else
                    {
                        tr_MeetTourContect.Visible = false;
                    }
                    if (!string.IsNullOrEmpty(model.CollectionContect))
                    {
                        ltrCollectionContect.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(model.CollectionContect);
                    }
                    else
                    {
                        tr_CollectionContect.Visible = false;
                    }
                    ResideContent       = EyouSoft.Common.Function.StringValidate.TextToHtml(model.ServiceStandard.ResideContent);       //住宿
                    DinnerContent       = EyouSoft.Common.Function.StringValidate.TextToHtml(model.ServiceStandard.DinnerContent);       //用餐
                    SightContent        = EyouSoft.Common.Function.StringValidate.TextToHtml(model.ServiceStandard.SightContent);        //景点
                    CarContent          = EyouSoft.Common.Function.StringValidate.TextToHtml(model.ServiceStandard.CarContent);          //用车
                    GuideContent        = EyouSoft.Common.Function.StringValidate.TextToHtml(model.ServiceStandard.GuideContent);        //导游
                    TrafficContent      = EyouSoft.Common.Function.StringValidate.TextToHtml(model.ServiceStandard.TrafficContent);      //往返交通
                    IncludeOtherContent = EyouSoft.Common.Function.StringValidate.TextToHtml(model.ServiceStandard.IncludeOtherContent); //其它
                    NotContainService   = EyouSoft.Common.Function.StringValidate.TextToHtml(model.ServiceStandard.NotContainService);   //其它说明
                    //备注
                    SpeciallyNotice = EyouSoft.Common.Function.StringValidate.TextToHtml(model.ServiceStandard.SpeciallyNotice);
                    //行程信息
                    rptStandardPlan.DataSource = model.StandardPlan;
                    rptStandardPlan.DataBind();
                }
                else//快速发布
                {
                    tr_MeetTourContect.Visible   = false;
                    tr_CollectionContect.Visible = false;
                    pnlQuickPlan.Visible         = true;
                    pnlNotQuickPlan.Visible      = false;
                    QuickPlanContent             = model.QuickPlan;
                }
            }
            Ibll       = null;
            model      = null;
            IOrderbll  = null;
            OrderModel = null;
            #endregion

            #region 公司盖章信息
            if (!string.IsNullOrEmpty(OrderID))
            {
                //判断是否属于该订单的专线商或组团社
                if (this.SiteUserInfo.CompanyID == BuyCompanyID || this.SiteUserInfo.CompanyID == SellCompanyID)
                {
                    string[] imgPath = EyouSoft.BLL.TourStructure.CompanyContractSignet.CreateInstance().GetConfirmationSignet(OrderID);
                    if (imgPath.Length > 0)
                    {
                        imgBuyCompany.ImageUrl = Domain.FileSystem + imgPath[0];
                        if (!string.IsNullOrEmpty(imgPath[0]))
                        {
                            imgBuyCompany.Visible = true;
                        }
                        if (!string.IsNullOrEmpty(imgPath[0]) && isTourCompany)
                        {
                            this.btnCancelStamp.Visible = true;
                            this.btnToStamp.Visible     = false;
                        }
                        if (imgPath.Length > 1)
                        {
                            imgSellCompany.ImageUrl = Domain.FileSystem + imgPath[1];
                            if (!string.IsNullOrEmpty(imgPath[1]))
                            {
                                imgSellCompany.Visible = true;
                            }
                            if (!string.IsNullOrEmpty(imgPath[1]) && !isTourCompany)
                            {
                                this.btnCancelStamp.Visible = true;
                                this.btnToStamp.Visible     = false;
                            }
                        }
                    }
                }
                else
                {
                    this.btnCancelStamp.Visible = false;
                    this.btnToStamp.Visible     = false;
                }
            }
            else
            {
                this.btnCancelStamp.Visible = false;
                this.btnToStamp.Visible     = false;
            }
            //if (!this.CheckGrant(EyouSoft.Common.TravelPermission.系统设置_盖章))
            //{
            this.btnCancelStamp.Visible = false;
            this.btnToStamp.Visible     = false;
            //}
            if (!isShow)
            {
                imgSellCompany.Visible = false;
                imgBuyCompany.Visible  = false;
            }
            #endregion
            IOrderbll   = null;
            OrderModel  = null;
            SellCompany = null;
            BuyCompany  = null;
        }