Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var comid = UserHelper.CurrentCompany.ID;

            typeid = Request["typeid"].ConvertTo <int>(0);
            id     = Request["id"].ConvertTo <int>(0);

            BindHeadPortrait();
            ShowImgBind();
            B2bModelData mdate = new B2bModelData();
            //判断模板,进行跳转
            var h5model = mdate.SelectModelSearchComid(comid);

            if (h5model != null)
            {
                Modelid = h5model.Modelid;
            }

            if (Modelid != 0)
            {
                var modeldata = new B2bModelData();
                var modelinfo = modeldata.GetModelById(Modelid);
                if (modelinfo != null)
                {
                    bjimage_w = modelinfo.Bgimage_w;
                    bjimage_h = modelinfo.Bgimage_h;
                }
            }

            if (bjimage_h != 0)
            {
                bgtishi = "图片大小 高:" + bjimage_h + "px 宽:" + bjimage_w + "px .请对图片进行处理,上传过大图片会影响浏览!";
            }
        }
Beispiel #2
0
        //排序
        public static string ModelMenuSort(string ids)
        {
            if (ids == "")
            {
                return(JsonConvert.SerializeObject(new { type = 1, msg = "没有排序的元素" }));
            }
            else
            {
                string[] str = ids.Split(',');

                string err = "";
                for (int i = 1; i <= str.Length; i++)
                {
                    string materialid = str[i - 1];
                    int    sortid     = i;
                    int    sortmenu   = new B2bModelData().ModelMenuSort(materialid, sortid);
                    if (sortmenu == 0)
                    {
                        err += materialid + "err;";
                    }
                }
                if (err == "")
                {
                    return(JsonConvert.SerializeObject(new { type = 100, msg = "菜单排序成功" }));
                }
                else
                {
                    return(JsonConvert.SerializeObject(new { type = 1, msg = err }));
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            var comid = UserHelper.CurrentCompany.ID;

            id = Request["id"].ConvertTo <int>(0);

            BindHeadPortrait();
            ShowImgBind();

            B2bModelData mdate = new B2bModelData();
            //判断模板,进行跳转
            var h5model = mdate.SelectModelSearchComid(comid);

            if (h5model != null)
            {
                Modelid = h5model.Modelid;
            }


            if (Modelid != 0)
            {
                var modeldata = new B2bModelData();
                var modelinfo = modeldata.GetModelById(Modelid);
                if (modelinfo != null)
                {
                    Daohangimg = modelinfo.Daohangimg;
                }
            }
        }
Beispiel #4
0
        private void ShowImgBind(int id)
        {
            //根据产品id得到 产品信息
            B2bModelData modeldate = new B2bModelData();
            var          proo      = modeldate.GetModelById(id);

            if (proo != null)
            {
                var identityFileUpload = new FileUploadData().GetFileById(proo.Bgimage.ToString().ConvertTo <int>(0));
                if (identityFileUpload != null)
                {
                    headPortraitImgSrc = identityFileUpload.Relativepath;
                }
                if (proo.Smallimg == null || proo.Smallimg == 0)
                {
                }
                else
                {
                    FileUploadModel smallidentityFileUpload = new FileUploadData().GetFileById(proo.Smallimg.ToString().ConvertTo <int>(0));
                    if (smallidentityFileUpload != null)
                    {
                        if (smallidentityFileUpload.Id != 0)
                        {
                            headSmalltraitImgSrc = smallidentityFileUpload.Relativepath;
                        }
                    }
                }
            }
        }
Beispiel #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //string u = Request.ServerVariables["HTTP_USER_AGENT"];
            //bool bo = detectmobilebrowser.HttpUserAgent(u);
            bool bo = true;

            string RequestUrl = Request.ServerVariables["SERVER_NAME"].ToLower();

            if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid
            {
                comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl).ToString());
            }
            else
            {
                B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl);
                if (companyinfo != null)
                {
                    comid = companyinfo.Com_id;
                }
            }
            if (comid != 0)
            {
                //根据公司id得到公司logo地址和公司名称
                comname = B2bCompanyData.GetCompany(comid).Com_name;
                B2b_company_saleset pro = B2bCompanySaleSetData.GetDirectSellByComid(comid.ToString());
                if (pro != null)
                {
                    comlogo = FileSerivce.GetImgUrl(pro.Logo.ConvertTo <int>(0));
                }

                //获取微信平台端code
                string weixincode = Request["code"].ConvertTo <string>("");

                if (weixincode != "")
                {
                    int questtype = 2;//1=微信授权验证
                    DealUserinfo1("", weixincode, comid, questtype);
                }
                else
                {
                    string openid     = Request["openid"].ConvertTo <string>("");
                    string weixinpass = Request["weixinpass"].ConvertTo <string>("");
                    int    questtype  = 1;                               //1=一次性密码验证
                    DealUserinfo1(openid, weixinpass, comid, questtype); //判断用户微信号(1,点击的转发链接进来的2,点击微信菜单进来的);使用户处于登录状态(不包括点击转发链接的)
                }

                B2bModelData mdate = new B2bModelData();
                //判断模板,进行跳转
                var h5model = mdate.SelectModelSearchComid(comid);
                if (h5model != null)
                {
                    if (h5model.Modelid != 1)
                    {
                        Response.Redirect("/h5/Default" + h5model.Modelid + ".aspx");
                    }
                }
            }
        }
Beispiel #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            comid = Request["comid"].ConvertTo <int>(0);

            B2bModelData mdate   = new B2bModelData();
            var          h5model = mdate.SelectModelSearchComid(comid);

            if (h5model != null)
            {
                Modelid = h5model.Modelid;
            }
        }
        private void ShowImgBind(int id)
        {
            //根据产品id得到 产品信息
            B2bModelData modeldate = new B2bModelData();
            var          proo      = modeldate.GetModelMenuById(id);

            if (proo != null)
            {
                var identityFileUpload = new FileUploadData().GetFileById(proo.Imgurl.ToString().ConvertTo <int>(0));
                if (identityFileUpload != null)
                {
                    headPortraitImgSrc = identityFileUpload.Relativepath;
                }
            }
        }
Beispiel #8
0
        /// <summary>
        ///  模板菜单修改
        /// </summary>
        /// <param name="order"></param>
        /// <returns></returns>
        public static string ModelMenuInsertOrUpdate(B2b_modelmenu model)
        {
            using (var helper = new SqlHelper())
            {
                try
                {
                    B2bModelData modeldata = new B2bModelData();

                    int orderid = modeldata.ModelMenuInsertOrUpdate(model);
                    return(JsonConvert.SerializeObject(new { type = 100, msg = orderid }));
                }
                catch (Exception ex)
                {
                    helper.Rollback();
                    return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message }));
                }
            }
        }
Beispiel #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            comid = Request["comid"].ConvertTo <int>(0);

            if (comid != 0)
            {
                B2bModelData mdate = new B2bModelData();
                //判断模板,进行跳转
                var h5model = mdate.SelectModelSearchComid(comid);
                if (h5model != null)
                {
                    if (h5model.Modelid != 1)
                    {
                        Response.Redirect("/h5/manage/Default" + h5model.Modelid + ".aspx?comid=" + comid);
                    }
                }
            }
        }
Beispiel #10
0
        public static string GetModelById(int modelid)
        {
            try
            {
                B2bModelData modedata = new B2bModelData();
                var          list     = modedata.GetModelById(modelid);
                if (list == null)
                {
                    return(JsonConvert.SerializeObject(new { type = 1, msg = "没有查询到列表", totalCount = 0 }));
                }
                return(JsonConvert.SerializeObject(new { type = 100, msg = list }));
            }
            catch (Exception ex)
            {
                return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message }));

                throw;
            }
        }
Beispiel #11
0
        public static string ModelPageList(int pageindex, int pagesize, int comid = 0)
        {
            int totalcount = 0;

            try
            {
                B2bModelData modedata = new B2bModelData();
                var          list     = modedata.ModelPageList(pageindex, pagesize, out totalcount);
                if (list == null)
                {
                    return(JsonConvert.SerializeObject(new { type = 1, msg = "没有查询到模板", totalCount = 0 }));
                }

                IEnumerable result = "";
                if (list != null)
                {
                    result = from pro in list
                             select new
                    {
                        Id         = pro.Id,
                        Title      = pro.Title,
                        Bgimage    = FileSerivce.GetImgUrl(pro.Bgimage),
                        Smallimg   = FileSerivce.GetImgUrl(pro.Smallimg),
                        Style_str  = pro.Style_str,
                        Html_str   = pro.Html_str,
                        Daohangnum = pro.Daohangnum,
                        Daohangimg = pro.Daohangimg,
                        Bgimage_h  = pro.Bgimage_h,
                        Bgimage_w  = pro.Bgimage_w,
                        Usestate   = modedata.UseComidModel(comid, pro.Id)
                    };
                }


                return(JsonConvert.SerializeObject(new { type = 100, msg = result, totalCount = totalcount }));
            }
            catch (Exception ex)
            {
                return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message }));

                throw;
            }
        }
Beispiel #12
0
        public static string ModelzhidingPageList(int id, int pageindex, int pagesize)
        {
            int totalcount = 0;

            try
            {
                B2bModelData modedata = new B2bModelData();
                var          list     = modedata.ModelzhidingPageList(id, pageindex, pagesize, out totalcount);
                if (list == null)
                {
                    return(JsonConvert.SerializeObject(new { type = 1, msg = "没有查询到模板", totalCount = 0 }));
                }
                return(JsonConvert.SerializeObject(new { type = 100, msg = list, totalCount = totalcount }));
            }
            catch (Exception ex)
            {
                return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message }));

                throw;
            }
        }
Beispiel #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var          comid = UserHelper.CurrentCompany.ID;
            B2bModelData mdate = new B2bModelData();
            //判断模板,进行跳转
            var h5model = mdate.SelectModelSearchComid(comid);

            if (h5model != null)
            {
                Modelid = h5model.Modelid;
            }


            if (Modelid != 0)
            {
                var modelinfo = mdate.GetModelById(Modelid);
                if (modelinfo != null)
                {
                    Daohangimg = modelinfo.Daohangimg;
                }
            }
        }
Beispiel #14
0
        public static string ModelMenuPageList(int modelid, int pageindex, int pagesize)
        {
            int totalcount = 0;

            try
            {
                B2bModelData modedata = new B2bModelData();
                var          list     = modedata.ModelMenuPageList(modelid, pageindex, pagesize, out totalcount);
                if (list == null)
                {
                    return(JsonConvert.SerializeObject(new { type = 1, msg = "没有查询到模板", totalCount = 0 }));
                }

                IEnumerable result = "";
                if (list != null)
                {
                    result = from pro in list
                             select new
                    {
                        Id             = pro.Id,
                        Name           = pro.Name,
                        Imgurl_address = FileSerivce.GetImgUrl(pro.Imgurl),
                        Imgurl         = pro.Imgurl,
                        Linkurl        = pro.Linkurl,
                        Modelid        = pro.Modelid,
                        Sortid         = pro.Sortid,
                        Fonticon       = pro.Fonticon
                    };
                }

                return(JsonConvert.SerializeObject(new { type = 100, msg = result, totalCount = totalcount }));
            }
            catch (Exception ex)
            {
                return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message }));

                throw;
            }
        }
Beispiel #15
0
        public static string GetimageLibraryList(int usetype, int pageindex, int pagesize, int modelid = 0)
        {
            int totalcount = 0;

            try
            {
                B2bCompanyImageData modedata = new B2bCompanyImageData();
                var modelmodel = new B2bModelData();
                var list       = modedata.GetimageLibraryList(usetype, pageindex, pagesize, out totalcount, modelid);
                if (list == null)
                {
                    return(JsonConvert.SerializeObject(new { type = 1, msg = "没有查询到图片", totalCount = 0 }));
                }

                IEnumerable result = "";
                if (list != null)
                {
                    result = from pro in list
                             select new
                    {
                        Id             = pro.Id,
                        Imgurl_address = FileSerivce.GetImgUrl(pro.Imgurl),
                        Imgurl         = pro.Imgurl,
                        Usetype        = pro.Usetype,
                        Width          = pro.Width,
                        Height         = pro.Height,
                        ModelName      = modelmodel.GetModelById(pro.Modelid) == null ? "" : modelmodel.GetModelById(pro.Modelid).Title
                    };
                }

                return(JsonConvert.SerializeObject(new { type = 100, msg = result, totalCount = totalcount }));
            }
            catch (Exception ex)
            {
                return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message }));

                throw;
            }
        }
Beispiel #16
0
        /// <summary>
        ///  选定模板
        /// </summary>
        /// <param name="order"></param>
        /// <returns></returns>
        public static string SelectModel(int modelid, int comid)
        {
            using (var helper = new SqlHelper())
            {
                int totalcount  = 0;
                int totalcount1 = 0;
                try
                {
                    B2bModelData modeldata    = new B2bModelData();
                    var          b2bmodel     = modeldata.GetModelById(modelid);
                    var          b2bmodelmenu = modeldata.ModelMenuPageList(modelid, 1, 100, out totalcount);

                    if (b2bmodel != null)
                    {
                        var delemodel = modeldata.DeleteSelectModel(comid);//删除已选择模板

                        H5_html model = new H5_html();
                        model.Comid     = comid;
                        model.Modelid   = modelid;
                        model.Style_str = b2bmodel.Style_str;
                        model.Html_str  = b2bmodel.Html_str;

                        //插入模板
                        int orderid = modeldata.SelectModel(model);

                        //原有图片都下线
                        var saledata   = new B2bCompanyImageData();
                        var bannerlist = saledata.UpAllDownState(comid);


                        //插入默认banner(也用于背景图片),重新选择模板后可能重复插入
                        B2bCompanyImageData modedata = new B2bCompanyImageData();
                        var imglist = modedata.GettypemodelidimageLibraryList(1, modelid, 1, 3, out totalcount1);
                        if (imglist != null)
                        {
                            for (int i = 0; i < imglist.Count; i++)
                            {
                                B2b_company_image imagemodel = new B2b_company_image()
                                {
                                    Id               = 0,
                                    Com_id           = comid,
                                    Typeid           = 0,
                                    Imgurl           = imglist[i].Imgurl,
                                    Linkurl          = "#",
                                    Title            = "#",
                                    Channelcompanyid = 0,
                                };
                                var crmid = saledata.InsertOrUpdate(imagemodel);
                            }
                        }


                        if (b2bmodelmenu != null)//首先判断模板里是否有默认栏目
                        {
                            var insertmenu = 0;
                            var imagedata  = new B2bCompanyMenuData();
                            var list       = imagedata.GetMenuList(comid, 1, 10, out totalcount);//如果已经有菜单的模板将不删除菜单,以后可增加判断是否删除菜单,有利于方便切换模板导航不需要重复修改,但容易出现因栏目图片不符新模板而影响使用。可先删除已有模板再进行切换

                            if (totalcount == 0)
                            {
                                insertmenu = modeldata.InsertSelectModelMenu(modelid, comid);//插入已选择模板菜单
                            }

                            //var deletemenu= modeldata.DeleteSelectModelMenu(comid);//删除已选择模板菜单
                            return(JsonConvert.SerializeObject(new { type = 100, msg = insertmenu }));
                        }
                    }

                    return(JsonConvert.SerializeObject(new { type = 1, msg = "选择模板错误,请重新尝试" }));
                }
                catch (Exception ex)
                {
                    helper.Rollback();
                    return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message }));
                }
            }
        }