Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            comid_temp = Request["comid"].ConvertTo <int>(0);

            B2b_company companyinfo = B2bCompanyData.GetAllComMsg(comid_temp);

            if (companyinfo != null)
            {
                company = companyinfo.Com_name;
            }



            if (Session["Agentid"] != null)
            {
                //账户信息
                Agentid = Int32.Parse(Session["Agentid"].ToString());
                Account = Session["Account"].ToString();

                Agent_company agenginfo = AgentCompanyData.GetAgentWarrant(Agentid, comid_temp);
                if (agenginfo != null)
                {
                    yufukuan     = "您预付款:" + agenginfo.Imprest + " 元";
                    Warrant_type = agenginfo.Warrant_type;
                }
            }
        }
Ejemplo n.º 2
0
        public int EditB2bCompanyInfo(B2b_company model, B2b_company_info model1, B2b_company_manageuser model2)
        {
            string procsql = "usp_EditComapnyInfo";

            var cmd = sqlHelper.PrepareStoredSqlCommand(procsql);

            //注册公司基本信息
            cmd.AddParam("@CompanyId", model.ID);
            cmd.AddParam("@Com_name", model.Com_name);
            cmd.AddParam("@Scenic_name", model.Scenic_name);
            cmd.AddParam("@Com_type", model.Com_type);
            cmd.AddParam("@Com_state", model.Com_state);
            cmd.AddParam("@Imprest", model.Imprest);
            cmd.AddParam("@Agentid", model.Agentid);
            //注册公司附加信息
            cmd.AddParam("@CompanyInfoId", model1.Id);
            cmd.AddParam("@CompanyInfoCom_id", model1.Com_id);
            cmd.AddParam("@Com_city", model1.Com_city);
            cmd.AddParam("@Com_add", model1.Com_add);
            cmd.AddParam("@Com_class", model1.Com_class);
            cmd.AddParam("@Com_code", model1.Com_code);
            cmd.AddParam("@Com_sitecode", model1.Com_sitecode);
            cmd.AddParam("@Com_license", model1.Com_license);
            cmd.AddParam("@Sale_Agreement", model1.Sale_Agreement);
            cmd.AddParam("@Agent_Agreement", model1.Agent_Agreement);
            cmd.AddParam("@Scenic_address", model1.Scenic_address);
            cmd.AddParam("@Scenic_intro", model1.Scenic_intro);
            cmd.AddParam("@Scenic_Takebus", model1.Scenic_Takebus);
            cmd.AddParam("@Scenic_Drivingcar", model1.Scenic_Drivingcar);
            cmd.AddParam("@Contact", model1.Contact);
            cmd.AddParam("@CompanyInfoTel", model1.Tel);
            cmd.AddParam("@Phone", model1.Phone);
            cmd.AddParam("@Qq", model1.Qq);
            cmd.AddParam("@Email", model1.Email);
            cmd.AddParam("@Defaultprint", model1.Defaultprint);
            cmd.AddParam("@Province", model1.Province);

            cmd.AddParam("@Serviceinfo", model1.Serviceinfo);
            cmd.AddParam("@Coordinate", model1.Coordinate);
            cmd.AddParam("@Coordinatesize", model1.Coordinatesize);
            cmd.AddParam("@Domainname", model1.Domainname);
            //注册公司员工信息
            cmd.AddParam("@CompanyUserId", model2.Id);
            cmd.AddParam("@CompanyUserCom_id", model2.Com_id);
            cmd.AddParam("@Accounts", model2.Accounts);
            cmd.AddParam("@Passwords", model2.Passwords);
            cmd.AddParam("@Atype", model2.Atype);
            cmd.AddParam("@Employeename", model2.Employeename);
            cmd.AddParam("@Job", model2.Job);
            cmd.AddParam("@CompanyUserTel", model2.Tel);
            cmd.AddParam("@Employeestate", model2.Employeestate);
            cmd.AddParam("@Createuserid", model2.Createuserid);
            cmd.AddParam("@channelcompanyid", model2.Channelcompanyid);
            cmd.AddParam("@channelsource", model2.Channelsource);

            var parm = cmd.AddReturnValueParameter("ReturnValue");

            cmd.ExecuteNonQuery();
            return((int)parm.Value);
        }
Ejemplo n.º 3
0
        /// <summary>
        ///  根据分销商绑定的商家标识列得到商家基本信息
        /// </summary>
        /// <param name="companyid"></param>
        /// <returns></returns>
        internal B2b_company GetCompanybyAgentid(int agentid)
        {
            const string sqlTxt = @"SELECT  *
              FROM  [dbo].[b2b_company] a where a.bindingagent=@ID";

            var cmd = sqlHelper.PrepareTextSqlCommand(sqlTxt);

            cmd.CommandType = CommandType.Text;
            cmd.AddParam("@ID", agentid);

            using (var reader = cmd.ExecuteReader())
            {
                B2b_company u = null;

                while (reader.Read())
                {
                    u = new B2b_company
                    {
                        ID             = reader.GetValue <int>("id"),
                        Com_name       = reader.GetValue <string>("com_name"),
                        Com_state      = reader.GetValue <int>("com_state"),
                        Com_type       = reader.GetValue <int>("com_type"),
                        Scenic_name    = reader.GetValue <string>("Scenic_name"),
                        Imprest        = reader.GetValue <decimal>("imprest"),
                        Fee            = reader.GetValue <decimal>("fee"),
                        ServiceFee     = reader.GetValue <decimal>("Servicefees"),
                        OpenDate       = reader.GetValue <DateTime>("OpenDate"),
                        EndDate        = reader.GetValue <DateTime>("EndDate"),
                        Agentopenstate = reader.GetValue <int>("Agentopenstate"),
                        Bindingagent   = reader.GetValue <int>("Bindingagent"),
                    };
                }
                return(u);
            }
        }
Ejemplo n.º 4
0
        internal B2b_company GetqunarbyQunarname(string supplierIdentity)
        {
            string sql = "select * from b2b_company where qunar_username='******'";
            var    cmd = sqlHelper.PrepareTextSqlCommand(sql);

            using (var reader = cmd.ExecuteReader())
            {
                B2b_company m = null;
                if (reader.Read())
                {
                    m = new B2b_company
                    {
                        isqunar        = reader.GetValue <int>("isqunar"),
                        qunar_username = reader.GetValue <string>("qunar_username"),
                        qunar_pass     = reader.GetValue <string>("qunar_pass"),

                        ID           = reader.GetValue <int>("id"),
                        Com_name     = reader.GetValue <string>("com_name"),
                        Com_state    = reader.GetValue <int>("com_state"),
                        Com_type     = reader.GetValue <int>("com_type"),
                        Scenic_name  = reader.GetValue <string>("Scenic_name"),
                        Imprest      = reader.GetValue <decimal>("imprest"),
                        Bindingagent = reader.GetValue <int>("Bindingagent"),
                    };
                }
                return(m);
            }
        }
Ejemplo n.º 5
0
        private void GetUser()
        {
            B2b_company_manageuser user    = UserHelper.CurrentUser();
            B2b_company            company = UserHelper.CurrentCompany;

            comid = company.ID;
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 用户登录
        /// </summary>
        public static bool Entry(string username, string password, out string message, out int userId)
        {
            userId = 0;
            var msg = "";
            B2b_company_manageuser user = B2bCompanyManagerUserData.VerifyUser(username, password, out msg);

            if (user == null)
            {
                message = msg;
                return(false);
            }


            userId = user.Id;
            B2b_company company = B2bCompanyData.GetCompany(user.Com_id);//根据公司id得到公司信息

            if (company == null)
            {
                message = "商家null";
                return(false);
            }
            else
            {
                if (company.Com_state == (int)CompanyStatus.InBusiness)
                {
                    message = "";
                    return(true);
                }
                else
                {
                    message = "商家状态不正确";
                    return(false);
                }
            }
        }
Ejemplo n.º 7
0
        public string contact_phone      = ""; //联系人电话
        protected void Page_Load(object sender, EventArgs e)
        {
            comid_temp = Request["comid"].ConvertTo <int>(0);
            projectid  = Request["projectid"].ConvertTo <int>(0);

            B2b_company companyinfo = B2bCompanyData.GetAllComMsg(comid_temp);

            if (companyinfo != null)
            {
                company       = companyinfo.Com_name;
                contact_phone = companyinfo.B2bcompanyinfo == null ? "" : companyinfo.B2bcompanyinfo.Tel;
            }

            if (projectid != 0)
            {
                B2b_com_projectData projectdata = new B2b_com_projectData();
                var projectinfo = projectdata.GetProject(projectid, comid_temp);
                if (projectinfo != null)
                {
                    projectname = projectinfo.Projectname + ": ";
                }
            }

            ishaslvyoubusproorder = new B2bOrderData().IsHasLvyoubusProOrder(comid_temp, (int)ProductServer_Type.LvyouBus);



            if (Session["Agentid"] != null)
            {
                //账户信息
                Agentid = Int32.Parse(Session["Agentid"].ToString());
                Account = Session["Account"].ToString();
            }
        }
Ejemplo n.º 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (UserHelper.ValidateLogin())
            {
                B2b_company company = UserHelper.CurrentCompany;

                //判断是否进行过微信接口设置,没有设置过进入微信接口设置页面
                WeiXinBasic b = new WeiXinBasicData().GetWxBasicByComId(company.ID);
                if (b == null)
                {
                    Response.Redirect("/weixin/ShangJiaSet2.aspx");
                }


                //显示菜单列表
                int pageindex = 1;
                int pagesize  = 10;
                int comid     = company.ID;
                GetMenuList(pageindex, pagesize, comid);//获得微信菜单
            }
            else
            {
                Response.Redirect("/Manage/index1.html");
            }
        }
Ejemplo n.º 9
0
        public static string AgentLoginCom(int userid, int comid)
        {
            string message = "";

            B2b_company company = B2bCompanyData.GetCompany(comid);//根据公司id得到公司信息

            if (company == null)
            {
                message = "商家null";
                return(JsonConvert.SerializeObject(new { type = 1, msg = message }));
            }
            else
            {
                if (company.Com_state == (int)CompanyStatus.InBusiness)
                {
                }
                else
                {
                    message = "商家状态不正确";
                    return(JsonConvert.SerializeObject(new { type = 1, msg = message }));
                }
            }

            UserHelper.SetCookie(userid);
            return(JsonConvert.SerializeObject(new { type = 100, msg = "" }));
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 编辑注册信息 by:xiaoliu
        /// </summary>
        /// <param name="b2b_company"></param>
        /// <param name="B2b_Company_Info"></param>
        /// <param name="manageuser"></param>
        /// <returns></returns>
        public static string InsertOrUpdateRegister(B2b_company b2b_company, B2b_company_info B2b_Company_Info, B2b_company_manageuser manageuser)
        {
            using (var sql = new SqlHelper())
            {
                try
                {
                    //判断登录账户是否存在
                    B2b_company_manageuser model2 = B2bCompanyManagerUserData.GetManageUserByAccount(manageuser.Accounts);
                    if (model2 != null)
                    {
                        return(JsonConvert.SerializeObject(new { type = 1, msg = "账户已经被注册" }));
                    }

                    //判断商家注册公司名称是否存在
                    B2b_company model1 = B2bCompanyManagerUserData.GetB2bCompanyByCompanyName(b2b_company.Com_name);
                    if (model1 != null)
                    {
                        return(JsonConvert.SerializeObject(new { type = 1, msg = "商家公司已经被注册" }));
                    }

                    int result = new InternalB2bCompany(sql).EditB2bCompanyInfo(b2b_company, B2b_Company_Info, manageuser);//编辑注册公司全部信息
                    if (result > 0)
                    {
                        //当注册成功 后,对绑定分销判断,如果有绑定分销直接进行绑定
                        if (b2b_company.Bindingagent != 0)
                        {
                            var bangdinginfo = AgentCompanyData.BindingAgent(result, b2b_company.Bindingagent);//商户和分销绑定

                            var prodata = new B2bCompanyInfoData();
                            var kaitong = prodata.UpComstate(result, "已暂停");//对暂停的 自动开通

                            //分配权限
                            int      createmasterid   = 0;
                            string   createmastername = "分销开商户自动分配微信负责人(1024)";
                            DateTime createdate       = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));

                            //获取
                            string masterid = B2bCompanyManagerUserData.GetFirstIDUser(result).ToString();


                            string data = PermissionJsonData.EditMasterGroup(masterid, manageuser.Accounts, "1024", createmasterid, createmastername, createdate);
                        }

                        return(JsonConvert.SerializeObject(new { type = 100, msg = "商家注册成功", result = result }));
                    }
                    else
                    {
                        return(JsonConvert.SerializeObject(new { type = 100, msg = "商家注册出现错误" }));
                    }
                }
                catch
                {
                    //sql.Rollback();
                    return(JsonConvert.SerializeObject(new { type = 1, msg = "商家注册出现意外错误" }));

                    throw;
                }
            }
        }
Ejemplo n.º 11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            B2b_company company = UserHelper.CurrentCompany;

            imprest = company.Imprest;

            fileurl = AppSettings.CommonSetting.GetValue("FileUpload/FileUrl").ConvertTo <string>();
        }
Ejemplo n.º 12
0
        public string gongsilogo   = "";   //公司logo

        protected void Page_Load(object sender, EventArgs e)
        {
            string u  = Request.ServerVariables["HTTP_USER_AGENT"];
            bool   bo = detectmobilebrowser.HttpUserAgent(u);//判断是否是手机访问


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

            #region 如果符合shop101.etown.cn的格式,根据微信配置信息获得公司信息(基本信息和扩展信息)
            if (Domain_def.Domain_yanzheng(RequestUrl))
            {
                WeiXinBasic wxbasic = new WeiXinBasicData().GetWeiXinBasicByDomain(RequestUrl);

                #region 如果配置了微信接口信息,获得公司信息
                if (wxbasic != null)
                {
                    int comid = wxbasic.Comid;
                    cominfo = B2bCompanyData.GetAllComMsg(comid);


                    //判断访问路径来源:1.微信认证商家直接点击自定义菜单链接过来,微信端传递过来code ;
                    string weixincode = Request["code"].ConvertTo <string>("");
                    if (weixincode != "")
                    {
                        if (cominfo != null)
                        {
                            GetOpenId(weixincode, cominfo.ID);
                            GetComLogo(cominfo.ID);
                        }
                    }
                    //2.微信未认证商家点击链接过来,传递过来openid和一次性密码(a.正确的openid和一次性密码,则实现会员登录和获得会员信息所在公司信息;b.一次性密码错误或者没有传递则 通过客户端保存数据获得用户信息)
                    string openid     = Request["openid"].ConvertTo <string>("");
                    string weixinpass = Request["weixinpass"].ConvertTo <string>("");
                    if (openid != "")
                    {
                        if (cominfo != null)
                        {
                            VerifyOneOffPass(openid, weixinpass, cominfo.ID);
                            GetComLogo(cominfo.ID);
                        }
                    }
                }
                #endregion
                #region 如果没有配置微信接口信息,不处理
                else
                {
                }
                #endregion
            }
            #endregion

            #region 如果不符合shop101.etown.cn的格式,不处理
            else
            {
            }
            #endregion
        }
Ejemplo n.º 13
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)
            {
                B2b_company company = B2bCompanyData.GetCompany(comid);
                if (company != null)
                {
                    companyname = company.Com_name;
                }
            }


            //Banner
            int totalcount = 0;
            B2bCompanyImageData      imgdata = new B2bCompanyImageData();
            List <B2b_company_image> imglist = imgdata.PageGetimageList(comid, 0, out totalcount);

            if (imglist != null)
            {
                for (int i = 0; i < totalcount; i++)
                {
                    if (title_arr == "")
                    {
                        title_arr = "\\\"" + imglist[i].Title + "\\\"";
                        img_arr   = "\\\"" + FileSerivce.GetImgUrl(imglist[i].Imgurl).Replace("/", "\\\\\\/") + "\\\"";
                        url_arr   = "\\\"" + imglist[i].Linkurl.Replace("/", "\\\\\\/") + "\\\"";;
                    }
                    else
                    {
                        title_arr += "," + "\\\"" + imglist[i].Title + "\\\"";
                        img_arr   += "," + "\\\"" + FileSerivce.GetImgUrl(imglist[i].Imgurl).Replace("/", "\\\\\\/") + "\\\"";
                        url_arr   += "," + "\\\"" + imglist[i].Linkurl.Replace("/", "\\\\\\/") + "\\\"";;
                    }
                }
            }
        }
Ejemplo n.º 14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            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)
            {
                B2b_company company = B2bCompanyData.GetCompany(comid);
                if (company != null)
                {
                    companyname = company.Com_name;
                    tel         = company.B2bcompanyinfo.Tel;
                }
            }


            //Banner
            int totalcount = 0;
            B2bCompanyImageData      imgdata = new B2bCompanyImageData();
            List <B2b_company_image> imglist = imgdata.PageGetimageList(comid, 0, out totalcount);

            if (imglist != null)
            {
                bannerstr   = "<ul> ";
                bannerolstr = " <ol>";


                for (int i = 0; i < totalcount; i++)
                {
                    bannerstr += "<li><a onclick=\"return false;\">	<img src=\"" + FileSerivce.GetImgUrl(imglist[i].Imgurl) + "\" alt=\"" + imglist[i].Title + "\" style=\"width:100%;\" /></a></li>";
                    if (i == 0)
                    {
                        bannerolstr += "<li class=\"on\"></li>";
                    }
                    else
                    {
                        bannerolstr += "<li ></li>";
                    }
                }

                bannerstr += "</ul>" + bannerolstr + "</ol>";
            }
        }
Ejemplo n.º 15
0
        public string contact_phone      = ""; //联系人电话
        protected void Page_Load(object sender, EventArgs e)
        {
            comid_temp = Request["comid"].ConvertTo <int>(0);
            projectid  = Request["projectid"].ConvertTo <int>(0);

            B2b_company companyinfo = B2bCompanyData.GetAllComMsg(comid_temp);

            if (companyinfo != null)
            {
                company       = companyinfo.Com_name;
                contact_phone = companyinfo.B2bcompanyinfo == null ? "" : companyinfo.B2bcompanyinfo.Tel;
            }

            if (projectid != 0)
            {
                B2b_com_projectData projectdata = new B2b_com_projectData();
                var projectinfo = projectdata.GetProject(projectid, comid_temp);
                if (projectinfo != null)
                {
                    projectname = projectinfo.Projectname + ": ";
                }
            }

            // ishaslvyoubusproorder = new B2bOrderData().IsHasLvyoubusProOrder(comid_temp, (int)ProductServer_Type.LvyouBus);



            if (Session["Agentid"] != null)
            {
                //账户信息
                Agentid = Int32.Parse(Session["Agentid"].ToString());
                Account = Session["Account"].ToString();



                Agent_company agenginfo = AgentCompanyData.GetAgentWarrant(Agentid, comid_temp);
                if (agenginfo != null)
                {
                    yufukuan     = "您预付款:" + agenginfo.Imprest.ToString("0.00") + " 元";
                    Warrant_type = agenginfo.Warrant_type;
                    if (Warrant_type == 1)
                    {
                        Warrant_type_str = "销售扣款";
                    }
                    if (Warrant_type == 2)
                    {
                        Warrant_type_str = "验证扣款";
                    }
                }
                else
                {
                    Response.Redirect("/Agent/Default.aspx");
                }
            }
        }
Ejemplo n.º 16
0
 public static string GetAllComMsg(int comid)
 {
     try
     {
         B2b_company com = B2bCompanyData.GetAllComMsg(comid);
         return(JsonConvert.SerializeObject(new { type = 100, msg = com }));
     }
     catch (Exception ex)
     {
         return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message }));
     }
 }
Ejemplo n.º 17
0
        public static string GetB2bCompanyByCompanyName(string companyname)
        {
            B2b_company company = B2bCompanyManagerUserData.GetB2bCompanyByCompanyName(companyname);

            if (company == null)
            {
                return(JsonConvert.SerializeObject(new { type = 1, msg = company }));
            }
            else
            {
                return(JsonConvert.SerializeObject(new { type = 100, msg = company }));
            }
        }
Ejemplo n.º 18
0
        public int comid   = 0;//当前登录商家id
        protected void Page_Load(object sender, EventArgs e)
        {
            agentid = Request["agentid"].ConvertTo <int>(0);
            if (agentid == 0)
            {
                //Response.Redirect("AgentList.aspx");
            }

            B2b_company_manageuser user    = UserHelper.CurrentUser();
            B2b_company            company = UserHelper.CurrentCompany;

            comid = company.ID;
        }
Ejemplo n.º 19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string u  = Request.ServerVariables["HTTP_USER_AGENT"];
            bool   bo = detectmobilebrowser.HttpUserAgent(u);

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

            if (materialid != 0)
            {
                //if (bo == false)
                //{
                //    if (materialid == 101)
                //    {
                //        Response.Redirect("http://vctrip.etown.cn/");
                //    }
                //    Response.Redirect("http://shop" + materialid + ".etown.cn");
                //}
                B2b_company_info info = new B2bCompanyInfoData().GetCompanyInfo(materialid);
                if (info != null)
                {
                    phone   = info.Tel;
                    address = info.Scenic_address;
                }
                B2b_company com = B2bCompanyData.GetCompany(materialid);
                if (com != null)
                {
                    name = com.Com_name;
                }


                if (Request.Cookies["AccountId"] != null)//判断是否有登陆COOKI
                {
                    string accountmd5 = "";
                    int    AccountId  = int.Parse(Request.Cookies["AccountId"].Value);
                    if (Request.Cookies["AccountKey"] != null)
                    {
                        accountmd5 = Request.Cookies["AccountKey"].Value;
                    }
                    B2b_crm userinfo;
                    var     data = CrmMemberJsonData.WeixinCookieLogin(AccountId.ToString(), accountmd5, materialid, out userinfo);
                    if (data == "OK")
                    {
                        if (userinfo != null)
                        {
                            string openid_temp = userinfo.Weixin;
                            GetMenshiDetail(openid_temp, materialid);
                        }
                    }
                }
            }
        }
Ejemplo n.º 20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            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;
                }

                if (comid != 0)
                {
                    comName = B2bCompanyData.GetCompany(comid).Com_name;

                    B2b_company_saleset pro = B2bCompanySaleSetData.GetDirectSellByComid(comid.ToString());
                }
            }
            else
            {
                B2b_company_info companyinfo = B2bCompanyData.GetComId(RequestUrl);
                if (companyinfo != null)
                {
                    comid = companyinfo.Com_id;
                    if (comid != 0)
                    {
                        comName = B2bCompanyData.GetCompany(comid).Com_name;
                    }
                }
            }

            if (comid != 0)
            {
                B2b_company companyinfo = B2bCompanyData.GetCompany(comid);
                if (companyinfo != null)
                {
                    comName = companyinfo.Com_name;
                    if (comName.Length >= 9)
                    {
                        comName = comName.Substring(0, 9) + "..";
                    }
                }

                B2b_company_saleset saleset = B2bCompanySaleSetData.GetDirectSellByComid(comid.ToString());
                if (saleset != null)
                {
                    phone = saleset.Service_Phone;
                }
            }
        }
Ejemplo n.º 21
0
        public bool IsParentCompanyUser = true; //判断操作账户类型(总公司账户;门市账户)
        protected void Page_Load(object sender, EventArgs e)
        {
            qunfa = Request["qunfa"].ConvertTo <string>("no");
            phone = Request["phone"].ConvertTo <string>("");

            //获取公司微信号
            B2b_company com = B2bCompanyData.GetAllComMsg(UserHelper.CurrentCompany.ID);

            weixinname = com.B2bcompanyinfo.Weixinname;

            int userid = UserHelper.CurrentUserId();

            IsParentCompanyUser = new B2bCompanyManagerUserData().IsParentCompanyUser(userid);
        }
Ejemplo n.º 22
0
 public static string Getchannelcompanyname(int channelcompanyid, int comid = 0)
 {
     if (comid == 0)
     {
         if (channelcompanyid == 0)
         {
             return(JsonConvert.SerializeObject(new { type = 1, msg = "" }));
         }
         else
         {
             Member_Channel_company company = new MemberChannelcompanyData().GetChannelCompany(channelcompanyid.ToString());
             if (company == null)
             {
                 return(JsonConvert.SerializeObject(new { type = 1, msg = "" }));
             }
             else
             {
                 return(JsonConvert.SerializeObject(new { type = 100, msg = company.Companyname }));
             }
         }
     }
     else
     {
         if (channelcompanyid == 0)
         {
             B2b_company company = B2bCompanyData.GetCompany(comid);
             if (company == null)
             {
                 return(JsonConvert.SerializeObject(new { type = 1, msg = "" }));
             }
             else
             {
                 return(JsonConvert.SerializeObject(new { type = 100, msg = company.Com_name }));
             }
         }
         else
         {
             Member_Channel_company company = new MemberChannelcompanyData().GetChannelCompany(channelcompanyid.ToString());
             if (company == null)
             {
                 return(JsonConvert.SerializeObject(new { type = 1, msg = "" }));
             }
             else
             {
                 return(JsonConvert.SerializeObject(new { type = 100, msg = company.Companyname }));
             }
         }
     }
 }
Ejemplo n.º 23
0
        public string contact_phone      = ""; //联系人电话
        protected void Page_Load(object sender, EventArgs e)
        {
            DateTime gooutdate = Request["gooutdate"].ConvertTo <DateTime>(DateTime.Now);

            nowdate   = gooutdate.ToString("yyyy-MM-dd");
            monthdate = DateTime.Parse(nowdate).AddDays(6).ToString("yyyy-MM-dd");

            servertype = (int)ProductServer_Type.LvyouBus;

            comid_temp = Request["comid"].ConvertTo <int>(0);
            if (comid_temp == 0)
            {
                Response.Redirect("/Agent/Default.aspx");
            }
            ishaslvyoubusproorder = new B2bOrderData().IsHasLvyoubusProOrder(comid_temp, (int)ProductServer_Type.LvyouBus);

            B2b_company companyinfo = B2bCompanyData.GetAllComMsg(comid_temp);

            if (companyinfo != null)
            {
                company       = companyinfo.Com_name;
                contact_phone = companyinfo.B2bcompanyinfo == null ? "" : companyinfo.B2bcompanyinfo.Tel;
            }
            if (Session["Agentid"] != null)
            {
                //账户信息
                Agentid = Int32.Parse(Session["Agentid"].ToString());
                Account = Session["Account"].ToString();
                Agent_company agenginfo = AgentCompanyData.GetAgentWarrant(Agentid, comid_temp);
                if (agenginfo != null)
                {
                    yufukuan     = "您预付款:" + agenginfo.Imprest.ToString("0.00") + " 元";
                    Warrant_type = agenginfo.Warrant_type;
                    if (Warrant_type == 1)
                    {
                        Warrant_type_str = "销售扣款";
                    }
                    if (Warrant_type == 2)
                    {
                        Warrant_type_str = "验证扣款";
                    }
                }
                else
                {
                    Response.Redirect("/Agent/Default.aspx");
                }
            }
        }
Ejemplo n.º 24
0
        public int InsertOrUpdate(B2b_company model)
        {
            var cmd = sqlHelper.PrepareStoredSqlCommand(SQLInsertOrUpdate);

            cmd.AddParam("@Id", model.ID);
            cmd.AddParam("@Com_name", model.Com_name);
            cmd.AddParam("@Scenic_name", model.Scenic_name);
            cmd.AddParam("@Com_type", model.Com_type);
            cmd.AddParam("@Com_state", model.Com_state);
            cmd.AddParam("@Imprest", model.Imprest);//修改不修改此参数

            var parm = cmd.AddReturnValueParameter("ReturnValue");

            cmd.ExecuteNonQuery();
            return((int)parm.Value);
        }
Ejemplo n.º 25
0
 public static B2b_company GetAllComMsgbyAgentid(int agentid)
 {
     using (var sql = new SqlHelper())
     {
         try
         {
             var         internalData = new InternalB2bCompany(sql);
             B2b_company com          = internalData.GetCompanybyAgentid(agentid);
             return(com);
         }
         catch
         {
             throw;
         }
     }
 }
Ejemplo n.º 26
0
 /// <summary>
 /// 添加或者编辑公司基本信息 By:Xiaoliu
 /// </summary>
 /// <param name="model">商家 实体</param>
 /// <returns>标识列</returns>
 public static int InsertOrUpdate(B2b_company model)
 {
     using (var sql = new SqlHelper())
     {
         try
         {
             var internalData = new InternalB2bCompany(sql);
             int result       = internalData.InsertOrUpdate(model);
             return(result);
         }
         catch
         {
             throw;
         }
     }
 }
Ejemplo n.º 27
0
 public static string GetAllComGuanzhuMsg(int comid)
 {
     try
     {
         B2b_company com = B2bCompanyData.GetAllComMsg(comid);
         if (com != null)
         {
             return(JsonConvert.SerializeObject(new { type = 100, msg = com.B2bcompanyinfo.Wxfocus_url }));
         }
         return(JsonConvert.SerializeObject(new { type = 1, msg = "失败" }));
     }
     catch (Exception ex)
     {
         return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message }));
     }
 }
Ejemplo n.º 28
0
        public string username         = "";//当前登录用户名
        protected void Page_Load(object sender, EventArgs e)
        {
            pno = Request["pno"].ConvertTo <string>("");
            validateticketlogid = Request["validateticketlogid"].ConvertTo <int>(0);

            B2b_company_manageuser user    = UserHelper.CurrentUser();
            B2b_company            company = UserHelper.CurrentCompany;

            comname = company.Scenic_name;

            B2bCompanyData datecom      = new B2bCompanyData();
            B2b_company    modledatecom = B2bCompanyData.GetAllComMsg(company.ID);

            printname = modledatecom.B2bcompanyinfo.Defaultprint;

            username = user.Accounts;
        }
Ejemplo n.º 29
0
        /// <summary>
        /// 根据商家id得到商家基本信息
        /// </summary>
        /// <param name="p"></param>
        /// <returns></returns>
        public static B2b_company GetCompany(int companyid)
        {
            using (var sql = new SqlHelper())
            {
                try
                {
                    var         internalData = new InternalB2bCompany(sql);
                    B2b_company result       = internalData.GetCompany(companyid);

                    return(result);
                }
                catch
                {
                    throw;
                }
            }
        }
Ejemplo n.º 30
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (UserHelper.ValidateLogin())
            {
                B2b_company company = UserHelper.CurrentCompany;
                comid = company.ID;
            }
            //TxtHelper.WriteFile("D:\\site\\b2betown\\ETS2.WebApp\\Log.txt", "001");
            #region  微信扫描二维码,都用易城微信号的
            comid = 106;
            string url = Request.Url.ToString();

            //根据传入参数openid、comid 得到 access_token、jsapi_ticket、noncestr、timestamp、 url(当前网页的URL,不包含#及其后面部分)
            WeiXinBasic basic = new WeiXinBasicData().GetWxBasicByComId(comid);
            if (basic != null)
            {
                appId     = basic.AppId;
                timestamp = new WeixinVoiceUtil().CreatenTimestamp();
                nonceStr  = new WeixinVoiceUtil().CreatenNonce_str();

                WXAccessToken maccesstoken = new WeixinVoiceUtil().GetAccessToken(comid, basic.AppId, basic.AppSecret);
                if (maccesstoken != null)
                {
                    string jsapi_ticket = new WeixinVoiceUtil().GetTickect(maccesstoken.ACCESS_TOKEN, comid);
                    if (jsapi_ticket == "")
                    {
                        isrightwxset = 0;
                    }
                    else
                    {
                        string beforesha1_signature = "";
                        signature = new WeixinVoiceUtil().GetSignature(jsapi_ticket, nonceStr, timestamp, url, out beforesha1_signature);
                    }
                }
                else
                {
                    isrightwxset = 0;
                }
            }
            else
            {
                isrightwxset = 0;
            }
            #endregion
        }