Esempio n. 1
0
        internal List <WxSalePromoteType> GetRecommendWxMaterialType(int comid, out int totalcount)
        {
            string sql = "select id,typename,typeclass from WxSalePromoteType where comid=" + comid + " and  id in (select salepromotetypeid from WxMenu where comid=" + comid + " and salepromotetypeid>0)";
            var    cmd = sqlHelper.PrepareTextSqlCommand(sql);

            List <WxSalePromoteType> list = new List <WxSalePromoteType>();

            using (var reader = cmd.ExecuteReader())
            {
                while (reader.Read())
                {
                    WxSalePromoteType wxmaterial = new WxSalePromoteType();

                    wxmaterial.Id        = reader.GetValue <int>("id");
                    wxmaterial.Typename  = reader.GetValue <string>("typename");
                    wxmaterial.Typeclass = reader.GetValue <string>("typeclass") == null ? "detail" : reader.GetValue <string>("typeclass");



                    list.Add(wxmaterial);
                }
            }
            totalcount = list.Count;

            return(list);
        }
Esempio n. 2
0
        internal List <WxSalePromoteType> Wxmaterialtypepagelist(int pageindex, int pagesize, out int totalcount)
        {
            var cmd          = this.sqlHelper.PrepareStoredSqlCommand("usp_PagingLarge");
            var tblName      = "WxSalePromoteType";
            var strGetFields = "*";
            var sortKey      = "id";
            var sortMode     = "0";

            var condition = "";


            cmd.PagingCommand(tblName, strGetFields, pageindex, pagesize, sortKey, sortMode, condition);


            List <WxSalePromoteType> list = new List <WxSalePromoteType>();

            using (var reader = cmd.ExecuteReader())
            {
                while (reader.Read())
                {
                    WxSalePromoteType wxmaterial = new WxSalePromoteType();

                    wxmaterial.Id        = reader.GetValue <int>("id");
                    wxmaterial.Typename  = reader.GetValue <string>("typename");
                    wxmaterial.Typeclass = reader.GetValue <string>("typeclass") == null ? "detail" : reader.GetValue <string>("typeclass");



                    list.Add(wxmaterial);
                }
            }
            totalcount = int.Parse(cmd.Parameters[7].Value.ToString());

            return(list);
        }
Esempio n. 3
0
        internal WxSalePromoteType GetMaterialType(int id, int comid)
        {
            string sql = @"SELECT [id]
      ,[typename]
     ,[typeclass]
     ,isshowpast
  FROM [EtownDB].[dbo].[WxSalePromoteType] where id=@id and comid=@comid";
            var    cmd = sqlHelper.PrepareTextSqlCommand(sql);

            cmd.AddParam("@id", id);
            cmd.AddParam("@comid", comid);


            using (var reader = cmd.ExecuteReader())
            {
                if (reader.Read())
                {
                    WxSalePromoteType wxMenu = new WxSalePromoteType();
                    wxMenu.Id         = reader.GetValue <int>("Id");
                    wxMenu.Typename   = reader.GetValue <string>("Typename");
                    wxMenu.Isshowpast = reader.GetValue <bool>("isshowpast");
                    wxMenu.Typeclass  = reader.GetValue <string>("typeclass") == null ? "detail" : reader.GetValue <string>("typeclass");

                    return(wxMenu);
                }
                else
                {
                    return(null);
                }
            }
        }
Esempio n. 4
0
        //查询类型名
        internal WxSalePromoteType GetWsptMenu(int id)
        {
            string sql = @"SELECT [id]
      ,[typename]
  FROM [EtownDB].[dbo].[WxSalePromoteType] where id=@id";
            var    cmd = sqlHelper.PrepareTextSqlCommand(sql);

            cmd.AddParam("@id", id);


            using (var reader = cmd.ExecuteReader())
            {
                if (reader.Read())
                {
                    WxSalePromoteType wxMenu = new WxSalePromoteType();
                    wxMenu.Id       = reader.GetValue <int>("Id");
                    wxMenu.Typename = reader.GetValue <string>("Typename");

                    return(wxMenu);
                }
                else
                {
                    return(null);
                }
            }
        }
Esempio n. 5
0
        protected void menu_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            int totalcount = 0;

            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                Repeater          rep  = e.Item.FindControl("Rplist") as Repeater; //找到里层的repeater对象
                WxSalePromoteType rowv = (WxSalePromoteType)e.Item.DataItem;       //找到分类Repeater关联的数据项
                typeid = Convert.ToInt32(rowv.Id);                                 //获取填充子类的id

                //if (typeid == 1 || typeid == 2 || typeid == 3 || typeid == 9 || typeid == 23)
                //{
                periodical period = new WxMaterialData().GetPeriodicalBySaleType(comid, typeid);

                List <WxMaterial> list = new WxMaterialData().periodicaltypelist(1, 20, 10, period.Id, typeid, out totalcount);
                //if (totalcount > 0)
                //{
                rep.DataSource = new WxMaterialData().periodicaltypelist(1, 20, 10, period.Id, typeid, out totalcount);
                rep.DataBind();
                //}
                //else
                //{
                //    Label lb = e.Item.FindControl("lblEmpty") as Label;
                //    lb.Text = "无推荐线路";
                //}


                periodnum = period.Percal;
                //}
            }
        }
Esempio n. 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int totalcount = 0;

            if (Session["AccountId"] != null)
            {
                //账户信息
                AccountId   = Int32.Parse(Session["AccountId"].ToString());
                AccountName = Session["AccountName"].ToString();
                AccountCard = Session["AccountCard"].ToString();
                RequestUrl  = Request.ServerVariables["SERVER_NAME"].ToLower();

                B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl);
                if (companyinfo != null)
                {
                    comid = companyinfo.Com_id;
                }

                //菜单项new WxSalePromoteTypeData()
                List <WxSalePromoteType> menulist = new WxSalePromoteTypeData().GetAllWxMaterialType(comid, out totalcount);
                menu.DataSource = menulist;
                menu.DataBind();
            }
            else
            {
                comid = 101;
                //菜单项new WxSalePromoteTypeData()
                List <WxSalePromoteType> menulist = new WxSalePromoteTypeData().GetAllWxMaterialType(comid, out totalcount);

                List <WxSalePromoteType> list = new List <WxSalePromoteType>();
                int[] i = { 0, 1, 2, 5 };
                foreach (int s in i)
                {
                    WxSalePromoteType wxmaterial = new WxSalePromoteType();

                    wxmaterial.Id       = menulist[s].Id;
                    wxmaterial.Typename = menulist[s].Typename;
                    list.Add(wxmaterial);
                }

                menu.DataSource = list;
                menu.DataBind();
            }
        }
Esempio n. 7
0
        protected void menu_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            int totalcount = 0;

            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                Repeater          rep  = e.Item.FindControl("Rplist") as Repeater; //找到里层的repeater对象
                WxSalePromoteType rowv = (WxSalePromoteType)e.Item.DataItem;       //找到分类Repeater关联的数据项
                typeid = Convert.ToInt32(rowv.Id);                                 //获取填充子类的id
                var period = new WxMaterialData().GetPeriodicalBySaleType(comid, typeid);
                if (period != null)
                {
                    rep.DataSource = new WxMaterialData().periodicaltypelist(1, 20, 10, period.Id, typeid, out totalcount);
                    rep.DataBind();

                    periodnum = period.Percal;
                }
            }
        }
Esempio n. 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            WxMaterialData Wx     = new WxMaterialData();
            WxMaterial     wmater = Wx.logGetidinfo(" SalePromoteTypeid !=4 order by operatime  desc ");

            int totalcount = 0;


            if (wmater != null)
            {
                Listtime = wmater.Operatime.ToString("yyyy-MM-dd");
            }


            ////判断如果是否为手机访问
            //if (detectmobilebrowser.HttpUserAgent(Request.ServerVariables["HTTP_USER_AGENT"]))
            //{
            //    if (Request["brow"]=="PC")//如果接收到传递PC访问则只PC版
            //    {
            //         Cookie.WriteCookie("Mobile_Brow_Set", "PC");
            //    }
            //
            //    //查看COOKIE 是否设定是否设定为PC
            //    if (Cookie.GetCookie("Mobile_Brow_Set") == "PC")
            //    {
            //    }
            //    else
            //    {
            //          Response.Redirect("/M/Default.aspx?brow=MO");
            //    }
            //}

            if (Session["AccountId"] != null)
            {
                //账户信息
                AccountId   = Int32.Parse(Session["AccountId"].ToString());
                AccountName = Session["AccountName"].ToString();
                AccountCard = Session["AccountCard"].ToString();
                RequestUrl  = Request.ServerVariables["SERVER_NAME"].ToLower();

                B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl);
                if (companyinfo != null)
                {
                    comid = companyinfo.Com_id;
                }

                if (comid != 101)
                {
                    Response.Redirect("/ui/shangjiaui/ProductList.aspx");
                }


                //会员信息
                B2bCrmData dateuser  = new B2bCrmData();
                B2b_crm    modeluser = dateuser.Readuser(AccountId, comid);

                if (modeluser != null)
                {
                    AccountWeixin = modeluser.Weixin;
                    AccountEmail  = modeluser.Email;
                    Accountphone  = modeluser.Phone;
                    Servercard    = modeluser.Servercard;
                    Imprest       = modeluser.Imprest;
                    Integral      = modeluser.Integral;
                    //密码
                    AccountPass = modeluser.Password1;
                    //微信关注
                    weixin = modeluser.Weixin == "" ? "未关注" : "已关注";
                }

                //渠道
                MemberChannelData channeldate = new MemberChannelData();

                //渠道信息
                Member_Channel channelmodel = channeldate.GetSelfChannelDetailByCardNo(AccountCard);
                if (channelmodel != null)
                {
                    channeltype = 1;
                    channelid   = channelmodel.Id;

                    RebateConsume = channelmodel.RebateConsume;
                    RebateOpen    = channelmodel.RebateOpen;
                    Opencardnum   = channelmodel.Opencardnum;
                    Firstdealnum  = channelmodel.Firstdealnum;
                    Summoney      = channelmodel.Summoney;
                }


                //服务专员信息,服务专员ID
                if (Servercard != 0)
                {
                    Member_Channel channelmode2 = channeldate.GetChannelDetail(Int32.Parse(Servercard.ToString()));
                    if (channelmode2 != null)
                    {
                        Servername   = channelmode2.Name;
                        Servermobile = channelmode2.Mobile;
                    }
                }

                //菜单项new WxSalePromoteTypeData()
                List <WxSalePromoteType> menulist = new WxSalePromoteTypeData().GetAllWxMaterialType(comid, out totalcount);

                if (comid == 101)
                {
                    List <WxSalePromoteType> list = new List <WxSalePromoteType>();
                    int[] i = { 0, 1, 2, 5, 12 };
                    foreach (int s in i)
                    {
                        WxSalePromoteType wxmaterial = new WxSalePromoteType();

                        wxmaterial.Id       = menulist[s].Id;
                        wxmaterial.Typename = menulist[s].Typename;
                        list.Add(wxmaterial);
                    }

                    menu.DataSource = list;
                    menu.DataBind();
                }
                else
                {
                    menu.DataSource = menulist;
                    menu.DataBind();
                }
            }
            else
            {
                Response.Redirect("/V/card.aspx");
            }
        }
Esempio n. 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["AccountId"] != null)
            {
                WxMaterialData Wx     = new WxMaterialData();
                WxMaterial     wmater = Wx.logGetidinfo(" SalePromoteTypeid !=4 order by operatime  desc ");

                int totalcount = 0;


                if (wmater != null)
                {
                    Listtime = wmater.Operatime.ToString("yyyy-MM-dd");
                }

                //账户信息
                AccountId   = Int32.Parse(Session["AccountId"].ToString());
                AccountName = Session["AccountName"].ToString();
                AccountCard = Session["AccountCard"].ToString();
                RequestUrl  = Request.ServerVariables["SERVER_NAME"].ToLower();

                B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl);
                if (companyinfo != null)
                {
                    comid = companyinfo.Com_id;
                }

                //会员信息
                B2bCrmData dateuser  = new B2bCrmData();
                B2b_crm    modeluser = dateuser.Readuser(AccountId, comid);

                if (modeluser != null)
                {
                    AccountWeixin = modeluser.Weixin;
                    AccountEmail  = modeluser.Email;
                    Accountphone  = modeluser.Phone;
                    Servercard    = modeluser.Servercard;
                    Imprest       = modeluser.Imprest;
                    Integral      = modeluser.Integral;
                    //密码
                    AccountPass = modeluser.Password1;
                    //微信关注
                    weixin = modeluser.Weixin == "" ? "未关注" : "已关注";
                }

                //渠道
                MemberChannelData channeldate = new MemberChannelData();

                //渠道信息
                Member_Channel channelmodel = channeldate.GetSelfChannelDetailByCardNo(AccountCard);
                if (channelmodel != null)
                {
                    channeltype = 1;
                    channelid   = channelmodel.Id;

                    RebateConsume = channelmodel.RebateConsume;
                    RebateOpen    = channelmodel.RebateOpen;
                    Opencardnum   = channelmodel.Opencardnum;
                    Firstdealnum  = channelmodel.Firstdealnum;
                    Summoney      = channelmodel.Summoney;
                }


                //服务专员信息,服务专员ID
                if (Servercard != 0)
                {
                    Member_Channel channelmode2 = channeldate.GetChannelDetail(Int32.Parse(Servercard.ToString()));
                    if (channelmode2 != null)
                    {
                        Servername   = channelmode2.Name;
                        Servermobile = channelmode2.Mobile;
                    }
                }

                ////菜单项new WxSalePromoteTypeData()
                //List<WxSalePromoteType> menulist = new WxSalePromoteTypeData().GetAllWxMaterialType(comid, out totalcount);

                //菜单项new WxSalePromoteTypeData()
                List <WxSalePromoteType> menulist = new WxSalePromoteTypeData().GetRecommendWxMaterialType(comid, out totalcount);

                if (comid == 101)
                {
                    List <WxSalePromoteType> list = new List <WxSalePromoteType>();
                    int[] i = { 0, 1, 2, 5, 12 };
                    foreach (int s in i)
                    {
                        WxSalePromoteType wxmaterial = new WxSalePromoteType();

                        wxmaterial.Id       = menulist[s].Id;
                        wxmaterial.Typename = menulist[s].Typename;
                        list.Add(wxmaterial);
                    }

                    menu.DataSource = list;
                    menu.DataBind();
                }
                else
                {
                    menu.DataSource = menulist;
                    menu.DataBind();
                }

                //得到微信会员卡说明和使用门店说明
                int ttcount = 0;
                mcMaterilList = new MemberShipCardMaterialData().GetMCMateralListByComId(comid, out ttcount);
            }
            else
            {
                Response.Redirect("/byts/login.aspx");
            }
        }
Esempio n. 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            WxMaterialData Wx     = new WxMaterialData();
            WxMaterial     wmater = Wx.logGetidinfo(" SalePromoteTypeid !=4 order by operatime  desc ");

            int totalcount = 0;


            if (wmater != null)
            {
                Listtime = wmater.Operatime.ToString("yyyy-MM-dd");
            }
            RequestUrl = Request.ServerVariables["SERVER_NAME"].ToString();
            comid      = Request["comid"].ConvertTo <int>(0);
            B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl);

            if (companyinfo != null)
            {
                comid = companyinfo.Com_id;
            }
            else
            { //判定是否为自助域名规则安 shop1.etown.cn
                if (Domain_def.Domain_yanzheng(RequestUrl))
                {
                    comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl));
                }
            }

            if (comid != 0)
            {
                B2b_company com = B2bCompanyData.GetAllComMsg(comid);

                if (com != null)
                {
                    Com_name     = com.Com_name;
                    Scenic_name  = com.Scenic_name;
                    Scenic_intro = com.B2bcompanyinfo.Scenic_intro;
                }
            }



            //菜单项new WxSalePromoteTypeData()
            List <WxSalePromoteType> menulist = new WxSalePromoteTypeData().GetAllWxMaterialType(comid, out totalcount);

            if (comid == 101)
            {
                List <WxSalePromoteType> list = new List <WxSalePromoteType>();
                int[] i = { 0, 1, 2, 5, 12 };
                foreach (int s in i)
                {
                    WxSalePromoteType wxmaterial = new WxSalePromoteType();

                    wxmaterial.Id       = menulist[s].Id;
                    wxmaterial.Typename = menulist[s].Typename;
                    list.Add(wxmaterial);
                }

                menu.DataSource = list;
                menu.DataBind();
            }
            else
            {
                List <WxSalePromoteType> list = new List <WxSalePromoteType>();
                //int[] i = { 0, 1, 2, 5, 12 };
                for (int s = 0; s < menulist.Count; s++)
                {
                    WxSalePromoteType wxmaterial = new WxSalePromoteType();

                    wxmaterial.Id       = menulist[s].Id;
                    wxmaterial.Typename = menulist[s].Typename;

                    var period = new WxMaterialData().GetPeriodicalBySaleType(comid, menulist[s].Id);
                    if (period != null)
                    {
                        list.Add(wxmaterial);
                    }
                }

                menu.DataSource = list;
                menu.DataBind();
            }
        }