Exemplo n.º 1
0
        /// <summary>
        /// 保存信息
        /// </summary>
        private void Save()
        {
            if (this.IsLogin)
            {
                if (!IsCompanyCheck)
                {
                    Response.Clear();
                    Response.Write("[{isSuccess:false,Message:'对不起,新注册用户还未审核,没有权限进入供应商网店管理!'}]");
                    Response.End();
                }

                string ComRemark = Server.UrlDecode(Request.Form["Remark"]);
                ComRemark = Utils.EditInputText(Server.UrlDecode(ComRemark.Substring(0, Remark.Length > 4000 ? 4000 : ComRemark.Length)));
                string ComShortRemark = Utils.GetFormValue("ShortRemark", 100);
                if (string.IsNullOrEmpty(ComShortRemark) && isShowShortRemark)
                {
                    Response.Clear();
                    Response.Write("[{isSuccess:false,Message:'主要优势不能为空!'}]");
                    Response.End();
                }
                EyouSoft.IBLL.CompanyStructure.ISupplierInfo Ibll = EyouSoft.BLL.CompanyStructure.SupplierInfo.CreateInstance();
                string ImgPath = Utils.GetFormValue("hidCompanyImg");
                if (!string.IsNullOrEmpty(Request.Form["ctl00$ContentPlaceHolder1$SingleFileUpload1$hidFileName"]))
                {
                    ImgPath = Utils.GetFormValue("ctl00$ContentPlaceHolder1$SingleFileUpload1$hidFileName");
                }
                bool isTrue = Ibll.Update(CompanyID, CompanyName, ComRemark, ComShortRemark, ImgPath);
                Ibll = null;
                if (isTrue)
                {
                    Response.Clear();
                    Response.Write("[{isSuccess:true,Message:'保存成功!'}]");
                    Response.End();
                }
            }
            else
            {
                Response.Clear();
                Response.Write("[{isSuccess:false,Message:'你还未登录或登录过期请重新登录!'}]");
                Response.End();
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 供应商单位信息保存
        /// </summary>
        private void SupplyInfoSave()
        {
            if (!IsCompanyCheck)
            {
                Response.Clear();
                Response.Write("[{isSuccess:false,Message:'对不起,新注册用户还未审核,没有权限进入供应商网店管理!'}]");
                Response.End();
            }
            bool   isTrue  = false;
            string webSite = string.Empty;

            EyouSoft.IBLL.CompanyStructure.ISupplierInfo       Ibll  = EyouSoft.BLL.CompanyStructure.SupplierInfo.CreateInstance();
            EyouSoft.Model.CompanyStructure.SupplierInfo       model = new EyouSoft.Model.CompanyStructure.SupplierInfo();
            IList <EyouSoft.Model.CompanyStructure.CompanyTag> lists = new List <EyouSoft.Model.CompanyStructure.CompanyTag>();

            EyouSoft.Model.CompanyStructure.CompanyRole RoleModel = new EyouSoft.Model.CompanyStructure.CompanyRole();
            model.ID             = CompanyID;
            model.CompanyName    = this.SiteUserInfo.CompanyName;//Utils.GetFormValue("MyOwenerShop_CompanyName");
            model.CompanyAddress = Utils.GetFormValue("MyOwenerShop_ConnectAddress");
            string Remark = Server.UrlDecode(Request.Form["MyOwenerShop_Remark"]);

            model.Remark = Utils.EditInputText(Server.UrlDecode(Remark.Substring(0, Remark.Length > 4000 ? 4000 : Remark.Length)));

            model.ContactInfo.Fax         = Utils.GetFormValue("MyOwenerShop_ConnectFax");
            model.ContactInfo.Tel         = Utils.GetFormValue("MyOwenerShop_ConnectTel");
            model.ContactInfo.Email       = Utils.GetFormValue("MyOwenerShop_ConnectEmail");
            model.ContactInfo.Mobile      = Utils.GetFormValue("MyOwenerShop_Mobile");
            model.ContactInfo.ContactName = Utils.GetFormValue("MyOwenerShop_ConnectName");
            model.ProvinceId = Utils.GetInt(Request.Form["ctl00$ContentPlaceHolder1$ProvinceAndCityList1$ddl_ProvinceList"]);
            model.CityId     = Utils.GetInt(Request.Form["ctl00$ContentPlaceHolder1$ProvinceAndCityList1$ddl_CityList"]);
            webSite          = Utils.GetFormValue("MyOwenerShop_WebSite");
            if (webSite != "")
            {
                model.WebSite = (webSite != "" && webSite.Contains("http://")) ? webSite : "http://" + webSite;
            }
            else
            {
                model.WebSite = webSite;
            }
            model.CompanyImgThumb = Utils.GetFormValue("ctl00$ContentPlaceHolder1$Upload_LogoImg$hidFileName");

            model.ShortRemark = Utils.GetFormValue("MyOwenerShop_ShortRemark");
            if (string.IsNullOrEmpty(model.CompanyImgThumb))
            {
                model.CompanyImgThumb = Utils.GetFormValue("hidLogoImg");
            }
            if (companyType == EyouSoft.Model.CompanyStructure.CompanyType.酒店)
            {
                EyouSoft.Model.CompanyStructure.CompanyTag sysModel;
                string[] strCompanyTag = Utils.GetFormValues("cbCompanyTag");
                for (int i = 0; i < strCompanyTag.Length; i++)
                {
                    sysModel           = new EyouSoft.Model.CompanyStructure.CompanyTag();
                    sysModel.FieldId   = Utils.GetInt(strCompanyTag[i]);
                    sysModel.FieldName = Utils.GetFormValue("hidCompanyTag" + strCompanyTag[i]);
                    lists.Add(sysModel);
                    sysModel = null;
                }
                EyouSoft.Model.CompanyStructure.HotelLevel level = (EyouSoft.Model.CompanyStructure.HotelLevel)Enum.Parse(typeof(EyouSoft.Model.CompanyStructure.HotelLevel), Utils.GetFormValue("ctl00$ContentPlaceHolder1$rbl_HotelLevel"));
                model.CompanyLevel = (int)level;
                model.CompanyTag   = lists;
            }
            isTrue = Ibll.Update(model);
            Ibll   = null;
            model  = null;
            lists  = null;
            if (isTrue)
            {
                Response.Clear();
                Response.Write("1");
                Response.End();
            }
        }