Example #1
0
        //通过id查询类型
        public static string SearchNamestring(string cardchl)
        {
            try
            {
                Member_Channel list      = null;
                var            channelid = MemberCardData.GetCardNumber(decimal.Parse(cardchl));
                using (var helper = new SqlHelper())
                {
                    if (channelid != null)
                    {
                        if (int.Parse(channelid.IssueCard.ToString()) != 0)
                        {
                            list = new InternalMemberChannel(helper).GetChannelDetail(int.Parse(channelid.IssueCard.ToString()));
                        }

                        if (list != null)
                        {
                            return(list.Name);
                        }
                        else
                        {
                            return("");
                        }
                    }
                    return("");
                }
            }
            catch
            {
                return("");
            }
        }
Example #2
0
 public int EditChannel(Member_Channel channel)
 {
     using (var helper = new SqlHelper())
     {
         var id = new InternalMemberChannel(helper).EditChannel(channel);
         return(id);
     }
 }
Example #3
0
        public string Servermobile = ""; //服务专员手机


        protected void Page_Load(object sender, EventArgs e)
        {
            openid     = Request["openid"];
            weixinpass = Request["weixinpass"];

            //如果SESSION有值,进行赋值
            if (openid != "" && Session["Openid"] != null)
            {
                openid = Session["Openid"].ToString();
            }



            //获得商户ID
            RequestUrl = Request.ServerVariables["SERVER_NAME"].ToLower();
            B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl);

            if (companyinfo != null)
            {
                comid             = companyinfo.Com_id;
                Session["Com_id"] = comid;
            }


            //已登录直接跳转
            if (Session["AccountId"] != null)
            {
                AccountId = Int32.Parse(Session["AccountId"].ToString());
                B2bCrmData dateuser1 = new B2bCrmData();
                B2b_crm    modeluser = dateuser1.Readuser(AccountId, comid);

                if (modeluser != null)
                {
                    AccountWeixin = modeluser.Weixin;
                    AccountEmail  = modeluser.Email;
                    Accountphone  = modeluser.Phone;
                    AccountName   = modeluser.Name;
                    AccountCard   = modeluser.Idcard.ToString();
                    Servercard    = modeluser.Servercard;
                    Integral      = modeluser.Integral;
                    Imprest       = modeluser.Imprest;
                }

                //服务专员信息,服务专员ID
                if (Servercard != 0)
                {
                    MemberChannelData channeldate  = new MemberChannelData();
                    Member_Channel    channelmode2 = channeldate.GetChannelDetail(Int32.Parse(Servercard.ToString()));
                    if (channelmode2 != null)
                    {
                        Servername   = channelmode2.Name;
                        Servermobile = channelmode2.Mobile;
                    }
                }
            }
        }
Example #4
0
 public static string EditChannel(Member_Channel channel)
 {
     try
     {
         var id = new MemberChannelData().EditChannel(channel);
         return(JsonConvert.SerializeObject(new { type = 100, msg = id }));
     }
     catch (Exception ex)
     {
         return(JsonConvert.SerializeObject(new
         {
             type = 1,
             msg = ex.Message
         }));
     }
 }
Example #5
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string oper = context.Request["oper"].ConvertTo <string>("");

            if (oper != "")
            {
                if (oper == "getunitlist")
                {
                    int    unittype = context.Request["unittype"].ConvertTo <int>(0);//默认显示内部渠道
                    string data     = ChannelJsonData.GetUnitList(unittype);
                    context.Response.Write(data);
                }
                if (oper == "getunitlistneww")
                {
                    int unittype = context.Request["unittype"].ConvertTo <int>(0);//默认显示内部渠道,加公司限制
                    int comid    = context.Request["comid"].ConvertTo <int>(0);
                    int actid    = context.Request["actid"].ConvertTo <int>(0);
                    int userid   = context.Request["userid"].ConvertTo <int>(0);

                    string data = ChannelJsonData.GetUnitList(comid, unittype, userid, actid);
                    context.Response.Write(data);
                }
                if (oper == "getunitlist2")                                                //只是用于员工管理页面
                {
                    string ischosen = context.Request["ischosen"].ConvertTo <string>("0"); //渠道来源中“所属门市”是否选中
                    int    userid   = context.Request["userid"].ConvertTo <int>(0);
                    string unittype = context.Request["unittype"].ConvertTo <string>("0"); //默认显示内部渠道,加公司限制
                    int    comid    = context.Request["comid"].ConvertTo <int>(0);

                    string data = ChannelJsonData.GetUnitList(comid, unittype, ischosen, userid);
                    context.Response.Write(data);
                }
                if (oper == "GetChannelCompanyList")
                {
                    string channeltype = context.Request["channeltype"].ConvertTo <string>("");
                    int    comid       = context.Request["comid"].ConvertTo <int>();
                    int    pageindex   = context.Request["pageindex"].ConvertTo <int>(1);
                    int    pagesize    = context.Request["pagesize"].ConvertTo <int>(10);

                    string data = ChannelJsonData.GetChannelCompanyList(comid, channeltype, pageindex, pagesize);
                    context.Response.Write(data);
                }
                if (oper == "GetChannelCompany")
                {
                    string channelcompanyid = context.Request["channelcompanyid"].ConvertTo <string>("");
                    string data             = ChannelJsonData.GetChannelCompany(channelcompanyid);
                    context.Response.Write(data);
                }
                if (oper == "getchanneldetail")
                {
                    int channelid = context.Request["channelid"].ConvertTo <int>(0);

                    string date = ChannelJsonData.GetChannelDetail(channelid);
                    context.Response.Write(date);
                }
                if (oper == "getchanneldetailnew")
                {
                    int    channelid = context.Request["channelid"].ConvertTo <int>(0);
                    int    comid     = context.Request["comid"].ConvertTo <int>(0);
                    string date      = ChannelJsonData.GetChannelDetail(channelid, comid);
                    context.Response.Write(date);
                }
                if (oper == "getchannelcompanyname")
                {
                    int comid            = context.Request["comid"].ConvertTo <int>(0);
                    int channelcompanyid = context.Request["channelcompanyid"].ConvertTo <int>(0);

                    string date = ChannelJsonData.Getchannelcompanyname(channelcompanyid, comid);
                    context.Response.Write(date);
                }
                if (oper == "editchannel")
                {
                    var id            = context.Request["id"];
                    var comid         = context.Request["comid"];
                    var Issuetype     = context.Request["Issuetype"];
                    var companyid     = context.Request["companyid"];
                    var name          = context.Request["name"];
                    var mobile        = context.Request["mobile"];
                    var cardcode      = context.Request["cardcode"].ConvertTo <decimal>(0);
                    var chadress      = context.Request["chadress"];
                    var chobjects     = context.Request["chobjects"];
                    var rebateopen    = context.Request["rebateopen"];
                    var rebateconsume = context.Request["rebateconsume"];
                    var rebateleval   = context.Request["rebateleval"];

                    var opencardnum  = context.Request["opencardnum"];
                    var firstdealnum = context.Request["firstdealnum"];
                    var summoney     = context.Request["summoney"];

                    int whetherdefaultchannel = context.Request["whetherdefaultchannel"].ConvertTo <int>(0);
                    int runstate = context.Request["runstate"].ConvertTo <int>(1);

                    Member_Channel channel = new Member_Channel()
                    {
                        Id                    = id.ConvertTo <int>(0),
                        Com_id                = comid.ConvertTo <int>(0),
                        Issuetype             = Issuetype.ConvertTo <int>(1),
                        Companyid             = companyid.ConvertTo <int>(0),
                        Name                  = name,
                        Mobile                = mobile,
                        Cardcode              = cardcode,
                        Chaddress             = chadress,
                        ChObjects             = chobjects,
                        RebateOpen            = rebateopen.ConvertTo <decimal>(0),
                        RebateConsume         = rebateconsume.ConvertTo <decimal>(0),
                        RebateConsume2        = 0,
                        RebateLevel           = rebateleval.ConvertTo <int>(0),
                        Opencardnum           = opencardnum.ConvertTo <int>(0),
                        Firstdealnum          = firstdealnum.ConvertTo <int>(0),
                        Summoney              = summoney.ConvertTo <decimal>(0),
                        Whetherdefaultchannel = whetherdefaultchannel,
                        Runstate              = runstate
                    };

                    string data = ChannelJsonData.EditChannel(channel);
                    context.Response.Write(data);
                }
                if (oper == "pagelist")
                {
                    var comid     = context.Request["comid"];
                    var pageindex = context.Request["pageindex"].ConvertTo <int>(0);
                    var pagesize  = context.Request["pagesize"].ConvertTo <int>(10);
                    var issuetype = context.Request["issuetype"].ConvertTo <string>("all");

                    var userid = context.Request["userid"].ConvertTo <int>(0);

                    string data = ChannelJsonData.PageList(comid, pageindex, pagesize, issuetype, userid);

                    context.Response.Write(data);
                }
                if (oper == "channellistbycomid")
                {
                    var comid     = context.Request["comid"];
                    var pageindex = context.Request["pageindex"].ConvertTo <int>(0);
                    var pagesize  = context.Request["pagesize"].ConvertTo <int>(10);


                    string data = ChannelJsonData.Channellistbycomid(comid, pageindex, pagesize);

                    context.Response.Write(data);
                }

                //渠道查询
                if (oper == "searchpagelist")
                {
                    var comid     = context.Request["comid"];
                    var pageindex = context.Request["pageindex"].ConvertTo <int>(0);
                    var pagesize  = context.Request["pagesize"].ConvertTo <int>(10);
                    var key       = context.Request["key"].ConvertTo <string>("");
                    var select    = context.Request["select"].ConvertTo <int>(0);

                    var    userid = context.Request["userid"].ConvertTo <int>(0);
                    string data   = ChannelJsonData.SeachList(comid, pageindex, pagesize, key, select, userid);

                    context.Response.Write(data);
                }
                if (oper == "editchannelcompany")
                {
                    var channelcompanyid = context.Request["channelcompanyid"].ConvertTo <int>(0);
                    var comid            = context.Request["comid"].ConvertTo <int>(0);
                    var Issuetype        = context.Request["Issuetype"].ConvertTo <int>(1);
                    var companyname      = context.Request["companyname"].ConvertTo <string>("");

                    string  companyaddress    = context.Request["companyaddress"].ConvertTo <string>("");
                    string  companyphone      = context.Request["companyphone"].ConvertTo <string>("");
                    decimal companyCoordinate = context.Request["companycoordinate"].ConvertTo <decimal>(0);
                    string  companyLocate     = context.Request["companyLocate"].ConvertTo <string>("");

                    int    companyimg     = context.Request["companyimg"].ConvertTo <int>(0);
                    string companyintro   = context.Request["companyintro"].ConvertTo <string>("");
                    string companyproject = context.Request["companyproject"].ConvertTo <string>("");

                    int companystate      = context.Request["companystate"].ConvertTo <int>(1);
                    int whetherdepartment = context.Request["whetherdepartment"].ConvertTo <int>(0);

                    string bookurl  = context.Request["bookurl"].ConvertTo <string>("");
                    string city     = context.Request["city"].ConvertTo <string>("");
                    string province = context.Request["Province"].ConvertTo <string>("");

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

                    Member_Channel_company company = new Member_Channel_company()
                    {
                        Id                = channelcompanyid,
                        Companyname       = companyname,
                        Com_id            = comid,
                        Issuetype         = Issuetype,
                        Companyaddress    = companyaddress,
                        Companyphone      = companyphone,
                        CompanyCoordinate = companyCoordinate,
                        CompanyLocate     = companyLocate,
                        Companyimg        = companyimg,
                        Companyintro      = companyintro,
                        Companyproject    = companyproject,
                        Companystate      = companystate,
                        Whetherdepartment = whetherdepartment,
                        Bookurl           = bookurl,
                        City              = city,
                        Province          = province,
                        Outshop           = outshop
                    };
                    string data = ChannelJsonData.EditChannelCompany(company);
                    context.Response.Write(data);
                }
                if (oper == "GetChannelByCompanyid")
                {
                    var    companyid = context.Request["companyid"];
                    string data      = ChannelJsonData.GetChannelByCompanyid(companyid);
                    context.Response.Write(data);
                }

                //修改渠道和推荐人
                if (oper == "upchannl")
                {
                    var comid      = context.Request["comid"].ConvertTo <int>(0);
                    var id         = context.Request["id"].ConvertTo <int>(0);
                    var channlcard = context.Request["channlcard"].ConvertTo <decimal>();
                    var oldcard    = context.Request["oldcard"].ConvertTo <decimal>();
                    var uptype     = context.Request["Uptype"].ConvertTo <int>();

                    string data = ChannelJsonData.Upchannl(id, comid, channlcard, oldcard, uptype);

                    context.Response.Write(data);
                }

                //修改门市店长推荐
                if (oper == "upchannelcompanproject")
                {
                    var comid          = context.Request["comid"].ConvertTo <int>(0);
                    var id             = context.Request["channelcompanyid"].ConvertTo <int>(0);
                    var companyproject = context.Request["companyproject"].ConvertTo <string>("");

                    string data = ChannelJsonData.Upchannelcompanproject(id, companyproject);

                    context.Response.Write(data);
                }

                //渠道统计
                if (oper == "Channelstatistics")
                {
                    var comid     = context.Request["comid"];
                    var pageindex = context.Request["pageindex"].ConvertTo <int>(0);
                    var pagesize  = context.Request["pagesize"].ConvertTo <int>(10);
                    //var issuetype = context.Request["issuetype"].ConvertTo<string>("all") == "all" ? "all" : context.Request["issuetype"];
                    string channelcompanytype = context.Request["channelcompanytype"].ConvertTo <string>("out");

                    string data = ChannelJsonData.Channelstatistics(comid, pageindex, pagesize, channelcompanytype);

                    context.Response.Write(data);
                }
                //渠道统计
                if (oper == "Channelstatistics2")
                {
                    var comid     = context.Request["comid"];
                    var pageindex = context.Request["pageindex"].ConvertTo <int>(0);
                    var pagesize  = context.Request["pagesize"].ConvertTo <int>(10);

                    string channelcompanytype = context.Request["channelcompanytype"].ConvertTo <string>("out");
                    string companystate       = context.Request["companystate"].ConvertTo <string>("1");

                    string data = ChannelJsonData.Channelstatistics2(comid, pageindex, pagesize, channelcompanytype, companystate);

                    context.Response.Write(data);
                }

                if (oper == "Channelstatistics3")
                {
                    int channelcompanyid = context.Request["channelcompanyid"].ConvertTo <int>(0);
                    var comid            = context.Request["comid"];
                    var pageindex        = context.Request["pageindex"].ConvertTo <int>(0);
                    var pagesize         = context.Request["pagesize"].ConvertTo <int>(10);

                    string channelcompanytype = context.Request["channelcompanytype"].ConvertTo <string>("out");
                    string companystate       = context.Request["companystate"].ConvertTo <string>("1");

                    string data = ChannelJsonData.Channelstatistics2(comid, pageindex, pagesize, channelcompanytype, companystate, channelcompanyid);

                    context.Response.Write(data);
                }
                //渠道统计_验卡
                if (oper == "ChannelYk")
                {
                    var    comid     = context.Request["comid"];
                    var    pageindex = context.Request["pageindex"].ConvertTo <int>(0);
                    var    pagesize  = context.Request["pagesize"].ConvertTo <int>(10);
                    var    issuetype = context.Request["issuetype"].ConvertTo <string>("all") == "all" ? "all" : context.Request["issuetype"];
                    string data      = ChannelJsonData.ChannelYk(comid, pageindex, pagesize, issuetype);

                    context.Response.Write(data);
                }
                if (oper == "GetAllInnerChannels")//得到所有的内部渠道
                {
                    string data = ChannelJsonData.GetAllInnerChannels();
                    context.Response.Write(data);
                }

                if (oper == "GetAllInnerChannelCompanys")//得到所有的内部渠道门市
                {
                    string data = ChannelJsonData.GetUnitList(0);
                    context.Response.Write(data);
                }
                if (oper == "GetUnitListNew")//得到内部/外部渠道门市
                {
                    int sourceid = context.Request["sourceid"].ConvertTo <int>(0);

                    string data = ChannelJsonData.GetUnitList(sourceid);
                    context.Response.Write(data);
                }

                if (oper == "GetUnitListselected")//得到渠道及被选中效果
                {
                    int actid = context.Request["actid"].ConvertTo <int>(0);

                    string data = ChannelJsonData.GetUnitListselected(actid);
                    context.Response.Write(data);
                }
                if (oper == "SearchChannelByChannelUnit")//得到渠道公司下的渠道列表
                {
                    var comid            = context.Request["comid"];
                    var pageindex        = context.Request["pageindex"].ConvertTo <int>(0);
                    var pagesize         = context.Request["pagesize"].ConvertTo <int>(10);
                    var channelcompanyid = context.Request["channelcompanyid"].ConvertTo <int>(0);


                    string data = ChannelJsonData.SearchChannelByChannelUnit(comid, pageindex, pagesize, channelcompanyid);

                    context.Response.Write(data);
                }
                if (oper == "Channelcompanypagelist")
                {
                    var comid     = context.Request["comid"];
                    var pageindex = context.Request["pageindex"].ConvertTo <int>(0);
                    var pagesize  = context.Request["pagesize"].ConvertTo <int>(10);
                    var key       = context.Request["key"].ConvertTo <string>("");

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

                    string channelcompanytype = context.Request["channelcompanytype"].ConvertTo <string>("0,1,3,4");
                    var    accountid          = 0;
                    if (context.Request.Cookies["AccountId"] != null)
                    {
                        accountid = context.Request.Cookies["AccountId"].Value.ConvertTo <int>(0);
                    }
                    var openid  = "";
                    var n1      = ""; //用户的精度
                    var e1      = ""; //用户的维度
                    var b2bdate = new B2bCrmData();

                    if (accountid != 0)
                    {
                        var b2bmodel = b2bdate.Readuser(accountid, int.Parse(comid));
                        if (b2bmodel != null)
                        {
                            openid = b2bmodel.Weixin;
                        }
                        var crmlocation = b2bdate.GetB2bCrmDistanceByid(openid);
                        if (crmlocation != "")
                        {
                            var locatarr = crmlocation.Split(',');
                            if (locatarr.Count() >= 2)
                            {
                                n1 = locatarr[1];
                                e1 = locatarr[0];
                            }
                        }
                    }



                    string data = ChannelJsonData.Channelcompanypagelist(comid, pageindex, pagesize, key, channelcompanyid, channelcompanytype, openid);

                    context.Response.Write(data);
                }

                if (oper == "ChannelcompanyOrderlocation")
                {
                    var comid     = context.Request["comid"];
                    var pageindex = context.Request["pageindex"].ConvertTo <int>(0);
                    var pagesize  = context.Request["pagesize"].ConvertTo <int>(10);
                    var key       = context.Request["key"].ConvertTo <string>("");

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

                    string channelcompanytype = context.Request["channelcompanytype"].ConvertTo <string>("0,1,3,4");
                    var    accountid          = 0;
                    if (context.Request.Cookies["AccountId"] != null)
                    {
                        accountid = context.Request.Cookies["AccountId"].Value.ConvertTo <int>(0);
                    }
                    var openid  = "";
                    var n1      = ""; //用户的精度
                    var e1      = ""; //用户的维度
                    var b2bdate = new B2bCrmData();

                    if (accountid != 0)
                    {
                        var b2bmodel = b2bdate.Readuser(accountid, int.Parse(comid));
                        if (b2bmodel != null)
                        {
                            openid = b2bmodel.Weixin;
                        }
                        var crmlocation = b2bdate.GetB2bCrmDistanceByid(openid);
                        if (crmlocation != "")
                        {
                            var locatarr = crmlocation.Split(',');
                            if (locatarr.Count() >= 2)
                            {
                                n1 = locatarr[1];
                                e1 = locatarr[0];
                            }
                        }
                    }

                    string data = ChannelJsonData.ChannelcompanyOrderlocation(comid, pageindex, pagesize, key, channelcompanyid, channelcompanytype, openid, n1, e1);

                    context.Response.Write(data);
                }


                if (oper == "adjustchannelcompanystatus")
                {
                    int    companyid = context.Request["companyid"].ConvertTo <int>(0);
                    int    status    = context.Request["status"].ConvertTo <int>(0);
                    string data      = ChannelJsonData.Adjustchannelcompanystatus(companyid, status);

                    context.Response.Write(data);
                }
            }
        }
Example #6
0
        public string errlog = "";//错误日志
        protected void Page_Load(object sender, EventArgs e)
        {
            RequestUrl = Request.ServerVariables["SERVER_NAME"].ToLower();

            try
            {
                //根据域名读取商户ID,如果没有绑定域名直接跳转后台
                if (Domain_def.Domain_yanzheng(RequestUrl))//如果符合shop101.etown.cn的格式,则从多微信商户基本信息表中获取comid
                {
                    //先通过正则表达式获取COMid
                    comid = Int32.Parse(Domain_def.Domain_Huoqu(RequestUrl).ToString());
                    if (comid == 0)
                    {
                        comid = new WeiXinBasicData().GetWeiXinBasicByDomain(RequestUrl).Comid;
                    }
                }
                else
                {
                    B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl);
                    if (companyinfo != null)
                    {
                        comid = companyinfo.Com_id;
                    }
                }
            }
            catch
            {
                errlog += "1,";
            }
            //获取微信平台端code
            string weixincode = Request["code"].ConvertTo <string>("");

            string openid     = Request["openid"].ConvertTo <string>("");
            string weixinpass = Request["weixinpass"].ConvertTo <string>("");

            GetMemberCard(openid, weixincode, weixinpass, comid);//登陆或得到会员信息



            var channeldata = new MemberChannelData();//读取渠道信息
            //判断对 微信注册,网站注册渠道进行归0
            var channeltype = channeldata.GetChannelDetail(int.Parse(channelid.ToString()));

            if (channeltype != null)
            {
                if (channeltype.Issuetype == 3 || channeltype.Issuetype == 4)
                {//如果渠道时微信注册或网站注册,渠道ID归0,下面自动重新分配有效渠道
                    channelid = 0;
                }
            }


            //创建新的微信一次性密码
            var new_weixinpass = new B2bCrmData().WeixinGetPass(openid, comid);

            if (channelid > 0)
            {
                //获得渠道发行信息
                MemberChannelData channeldate  = new MemberChannelData();
                Member_Channel    channelmodel = channeldate.GetChannelDetail(channelid);

                if (channelmodel != null)
                {
                    //channelid = channelmodel.Id;
                    //channelphone = channelmodel.Mobile;
                    //RebateConsume = channelmodel.RebateConsume;
                    //RebateOpen = channelmodel.RebateOpen;
                    //Opencardnum = channelmodel.Opencardnum;
                    //Firstdealnum = channelmodel.Firstdealnum;
                    //Summoney = channelmodel.Summoney;

                    //根据渠道电话得到渠道对应的员工信息
                    B2b_company_manageuser userrr = new B2bCompanyManagerUserData().GetCompanyUserByPhone(channelmodel.Mobile, comid);
                    if (userrr != null)
                    {
                        Response.Redirect("http://shop" + comid + ".etown.cn/h5/people.aspx?MasterId=" + userrr.Id);
                    }
                }


                Response.Redirect("http://shop" + comid + ".etown.cn/h5/peoplelist.aspx");
            }
            else
            {
                Response.Redirect("http://shop" + comid + ".etown.cn/h5/peoplelist.aspx");
            }
        }
Example #7
0
        //读取用户信息
        private void Readuser(decimal idcard, int comid)
        {
            Today = DateTime.Now.ToString("yyyy-MM-dd");
            B2bCrmData dateuser = new B2bCrmData();

            var userinfo = dateuser.GetB2bCrmByCardcode(idcard);

            if (userinfo != null)
            {
                AccountId = userinfo.Id;
                Integral  = userinfo.Integral.ToString() == "" ? "0" : userinfo.Integral.ToString();
                Imprest   = userinfo.Imprest.ToString() == "" ? "0" : userinfo.Imprest.ToString();

                AccountWeixin = userinfo.Weixin;
                AccountEmail  = userinfo.Email;
                Accountphone  = userinfo.Phone;
                AccountCard   = userinfo.Idcard.ToString();


                if (Accountphone != "")
                {
                    var channel_temp = new MemberChannelData().GetChannelid(userinfo.Com_id, Accountphone);
                    if (channel_temp != 0)
                    {
                        unchannel = 1; //标注为渠道
                    }
                }


                string a = AccountCard.Substring(0, 1);
                if (a != null)
                {
                    fcard = int.Parse(a.ToString());
                }


                //获取预付款记录
                B2bFinanceData fdate      = new B2bFinanceData();
                int            totalcount = 0;
                var            list       = fdate.ImprestList(1, 10, comid, out totalcount, userinfo.Id);
                if (list != null)
                {
                    Imprestlist = "<ul>";
                    for (int i = 0; i < list.Count; i++)
                    {
                        if (list[i].Money < 0)
                        {
                            Imprestlist += "<li>" + list[i].Subdate + "  支出:" + list[i].Money.ToString("0.00") + "元</li>";
                        }
                        else
                        {
                            Imprestlist += "<li>" + list[i].Subdate + "  获得:" + list[i].Money.ToString("0.00") + "元</li>";
                        }
                    }
                    Imprestlist += "</ul>";
                }


                //获取积分记录
                var integrallist = fdate.IntegralList(1, 10, comid, out totalcount, userinfo.Id);
                if (integrallist != null)
                {
                    Integrallist = "<ul>";
                    for (int i = 0; i < integrallist.Count; i++)
                    {
                        if (integrallist[i].Money < 0)
                        {
                            Integrallist += "<li>" + integrallist[i].Subdate + "  支出:" + integrallist[i].Money.ToString("0") + "</li>";
                        }
                        else
                        {
                            Integrallist += "<li>" + integrallist[i].Subdate + "  获得:" + integrallist[i].Money.ToString("0") + "</li>";
                        }
                    }
                    Integrallist += "</ul>";
                }


                //消费记录
                string       proname    = "";
                string       orderstate = "";
                B2bOrderData dataorder  = new B2bOrderData();
                var          prodata    = new B2bComProData();
                var          order      = dataorder.ConsumerOrderPageList("", 1, 10, userinfo.Id, out totalcount);
                if (order != null)
                {
                    Orderlist = "<ul>";
                    for (int i = 0; i < order.Count; i++)
                    {
                        var promodel = prodata.GetProById(order[i].Pro_id.ToString());
                        if (promodel != null)
                        {
                            proname = promodel.Pro_name;
                        }

                        orderstate = EnumUtils.GetName((OrderStatus)order[i].Order_state);

                        Orderlist += "<li>" + proname + "(" + order[i].U_subdate + ") " + order[i].U_num + "(" + orderstate + ")</li>";
                    }
                    Orderlist += "</ul>";
                }



                //当读取用户信息的时候,判断是否有渠道转发信息
                if (Request.Cookies["ZF_ChanneId"] != null)
                {
                    int ZF_ChanneId = 0;
                    ZF_ChanneId = int.Parse(Request.Cookies["ZF_ChanneId"].Value);
                    if (ZF_ChanneId != 0)
                    { //有转发渠道ID
                        //在这判断 用户渠道是否为微信注册过来的
                        Member_Channel channel2 = new MemberChannelData().GetChannelByOpenId(userinfo.Weixin);
                        if (channel2 != null)
                        {
                            if (channel2.Issuetype == 4)
                            {
                                //如果为微信注册过来的 ,则修改会员渠道即可
                                int upchannel = new MemberCardData().upCardcodeChannel(userinfo.Idcard.ToString(), ZF_ChanneId);
                            }
                        }
                        else
                        {
                            //没有渠道的 ,则修改会员渠道即可
                            int upchannel = new MemberCardData().upCardcodeChannel(userinfo.Idcard.ToString(), ZF_ChanneId);
                        }

                        //清除Cookies
                        HttpCookie aCookie = new HttpCookie("ZF_ChanneId");
                        aCookie.Expires = DateTime.Now.AddDays(-1);
                        Response.Cookies.Add(aCookie);
                    }
                }


                dateuser.WeixinConPass(userinfo.Weixin, comid);//只要包含SESSION登陆成功,清空微信密码
            }


            //获得渠道发行信息
            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;
            }
        }
Example #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");
            }
        }
Example #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");
            }
        }
Example #10
0
 public static string EditChannelCompany(Member_Channel_company company)
 {
     try
     {
         int id = new MemberChannelcompanyData().EditChannelCompany(company);
         if (company.Id == 0)//如果是添加渠道单位操作,则默认添加一个此单位下的渠道人
         {
             Member_Channel channel = new Member_Channel()
             {
                 Id                    = 0,
                 Com_id                = company.Com_id,
                 Issuetype             = company.Issuetype,
                 Companyid             = id,
                 Name                  = "默认渠道",
                 Mobile                = "",
                 Cardcode              = 0,
                 Chaddress             = "",
                 ChObjects             = "",
                 RebateOpen            = 0,
                 RebateConsume         = 0,
                 RebateConsume2        = 0,
                 RebateLevel           = 0,
                 Opencardnum           = 0,
                 Firstdealnum          = 0,
                 Summoney              = 0,
                 Whetherdefaultchannel = 1,
                 Runstate              = 1
             };
             int idd = new MemberChannelData().EditChannel(channel);
             if (id > 0 && idd > 0)
             {
                 return(JsonConvert.SerializeObject(new { type = 100, msg = id }));
             }
             else
             {
                 return(JsonConvert.SerializeObject(new { type = 1, msg = "编辑渠道时出现错误" }));
             }
         }
         else
         {
             //判断渠道公司中是否含有默认渠道,没有的话添加进去
             int numm = new MemberChannelData().GetDefaultChannelNum(company.Id);
             if (numm == 0)
             {
                 Member_Channel channel = new Member_Channel()
                 {
                     Id                    = 0,
                     Com_id                = company.Com_id,
                     Issuetype             = company.Issuetype,
                     Companyid             = id,
                     Name                  = "默认渠道",
                     Mobile                = "",
                     Cardcode              = 0,
                     Chaddress             = "",
                     ChObjects             = "",
                     RebateOpen            = 0,
                     RebateConsume         = 0,
                     RebateConsume2        = 0,
                     RebateLevel           = 0,
                     Opencardnum           = 0,
                     Firstdealnum          = 0,
                     Summoney              = 0,
                     Whetherdefaultchannel = 1
                 };
                 int idd = new MemberChannelData().EditChannel(channel);
                 if (id > 0 && idd > 0)
                 {
                     return(JsonConvert.SerializeObject(new { type = 100, msg = id }));
                 }
                 else
                 {
                     return(JsonConvert.SerializeObject(new { type = 1, msg = "编辑渠道时出现错误" }));
                 }
             }
             else
             {
                 if (id > 0)
                 {
                     return(JsonConvert.SerializeObject(new { type = 100, msg = id }));
                 }
                 else
                 {
                     return(JsonConvert.SerializeObject(new { type = 1, msg = "编辑渠道时出现错误" }));
                 }
             }
         }
     }
     catch (Exception ex)
     {
         return(JsonConvert.SerializeObject(new
         {
             type = 1,
             msg = ex.Message
         }));
     }
 }