public static string Manageuserpagelist(string comid, int pageindex, int pagesize) { var totalcount = 0; try { var prodata = new B2bCompanyManagerUserData(); var list = prodata.Manageuserpagelist(comid, pageindex, pagesize, out totalcount); IEnumerable result = ""; if (list != null) { result = from pro in list select new { id = pro.Id, name = pro.Employeename, power = EnumUtils.GetName((ManageUserPower)pro.Atype) } } ; return(JsonConvert.SerializeObject(new { type = 100, totalCount = totalcount, msg = result })); } catch (Exception ex) { return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message })); throw; } }
public static string ViewChildCompany(int childcomid, int curuserid) { //当前用户为“平台总账户”才可登录子商户 if (curuserid == 1035) { //得到子商户的直销网站经理的账户信息 B2b_company_manageuser childcompanyuser = new B2bCompanyManagerUserData().Getchildcompanyuser(childcomid); if (childcompanyuser != null) { ////注销当前账户 //UserHelper.DirictLogout(); //登录子商户的直销网站经理账户 UserHelper.SetCookie(childcompanyuser.Id); return(JsonConvert.SerializeObject(new { type = 100, msg = "" })); } else { return(JsonConvert.SerializeObject(new { type = 1, msg = "" })); } } else { return(JsonConvert.SerializeObject(new { type = 1, msg = "只有平台总账户才具有此功能" })); } }
public static string ViewQQpagelist(int comid, int channelcompanyid, int pageindex, int pagesize, string key = "", string openid = "", string usern = "", string usere = "") { var totalcount = 0; try { B2bCrmData crmdata = new B2bCrmData(); var prodata = new B2bCompanyManagerUserData(); var list = prodata.ViewQQpagelist(comid, channelcompanyid, pageindex, pagesize, out totalcount, key, openid, usern, usere); IEnumerable result = ""; if (list != null) { result = from pro in list select new { Id = pro.Id, Name = pro.Employeename, QQ = pro.QQ, } } ; return(JsonConvert.SerializeObject(new { type = 100, totalCount = totalcount, msg = result })); } catch (Exception ex) { return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message })); throw; } }
public static string Changestaffpwd(int staffid, string password, B2b_company_manageuser manageruser = null) { try { int result = 0; if (manageruser != null) { result = B2bCompanyManagerUserData.InsertOrUpdate(manageruser); } else { result = ExcelSqlHelper.ExecuteNonQuery("update b2b_company_manageuser set passwords ='" + password + "' where id=" + staffid); } return(JsonConvert.SerializeObject(new { type = 100, msg = result })); } catch (Exception ex) { return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message })); throw; } }
//private static EntryLogCaching caching = new EntryLogCaching(); #region 获取当前登录用户信息 By:Xiaoxiong /// <summary> /// 获取当前登录用户的ID By:Xiaoxiong /// </summary> /// <returns>当前登录用户的ID</returns> public static B2b_company_manageuser CurrentUser(int userId = 0) { var identity = HttpContext.Current.User.Identity; if (!identity.IsAuthenticated) { HttpContext.Current.Response.Redirect(FormsAuthentication.LoginUrl); } if (userId == 0 && !string.IsNullOrEmpty(identity.Name)) { userId = int.Parse(identity.Name); } if (userId == 0) { if (!HttpContext.Current.Response.IsRequestBeingRedirected) { HttpContext.Current.Response.Redirect(FormsAuthentication.LoginUrl); } return(null); } B2b_company_manageuser user = B2bCompanyManagerUserData.GetUser(userId); if (user == null || user.Id != userId || !VerifyToken(userId)) { if (!HttpContext.Current.Response.IsRequestBeingRedirected) { HttpContext.Current.Response.Redirect(FormsAuthentication.LoginUrl); } } return(user); }
/// <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); } } }
public static string MasterpagelistByComId(int pageindex, int pagesize, string comid, int userid) { var totalcount = 0; try { var list = new B2bCompanyManagerUserData().Manageuserpagelist(comid, pageindex, pagesize, out totalcount, userid); IEnumerable result = ""; if (list != null) { result = from model in list select new { Accounts = model.Accounts, PassWord = model.Passwords, MasterId = model.Id, MasterName = model.Employeename, CompanyName = B2bCompanyData.GetCompanyByUid(model.Id).Com_name, Tel = model.Tel, GroupName = new Sys_MasterGroupData().GetGroupNameStrByMasterId(model.Id) } } ; return(JsonConvert.SerializeObject(new { type = 100, totalCount = totalcount, msg = result })); } catch (Exception ex) { return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message })); throw; } }
public static string ChangeIsDefaultKf(int userid) { try { var manageuserdata = new B2bCompanyManagerUserData(); var managuserinfo = manageuserdata.GetCompanyUser(userid); if (managuserinfo == null) { return(JsonConvert.SerializeObject(new { type = 1, msg = "员工信息错误" })); } int Isdefaultkf = 0; if (managuserinfo.Isdefaultkf == 0) { Isdefaultkf = 1; } else { Isdefaultkf = 0; } var list = B2bCompanyManagerUserData.ChangeIsDefaultKf(userid, Isdefaultkf); return(JsonConvert.SerializeObject(new { type = 100, msg = list })); } catch (Exception ex) { return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message })); throw; } }
public static string Masterpagelist(string employstate, int pageindex, int pagesize, string groupid, int childcomid, string key = "") { var totalcount = 0; try { var list = new B2bCompanyManagerUserData().Masterpagelist(employstate, pageindex, pagesize, groupid, childcomid, out totalcount, key); IEnumerable result = ""; if (list != null) { result = from model in list select new { Accounts = model.Accounts, PassWord = model.Passwords, MasterId = model.Id, MasterName = model.Employeename, CompanyName = B2bCompanyData.GetCompanyByUid(model.Id).Com_name, Tel = model.Tel, GroupName = new Sys_MasterGroupData().GetGroupNameStrByMasterId(model.Id), ChannelCompanyName = model.Channelcompanyid == null || model.Channelcompanyid == 0 ? "--" : new MemberChannelcompanyData().GetCompanyById(int.Parse(model.Channelcompanyid.ToString())) == null ? "--" : new MemberChannelcompanyData().GetCompanyById(int.Parse(model.Channelcompanyid.ToString())).Companyname, Employeestate = model.Employeestate } } ; return(JsonConvert.SerializeObject(new { type = 100, totalCount = totalcount, msg = result })); } catch (Exception ex) { return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message })); throw; } }
public string channelcompanyid = "0"; //渠道公司id protected void Page_Load(object sender, EventArgs e) { channelid = Request["channelid"].ConvertTo <string>("0"); if (channelid == "0") { Response.Redirect("/ui/MemberUI/Channelstatistics.aspx"); } channeltype = Request["channeltype"].ConvertTo <string>("out"); if (channeltype == "inner") { channeltype = "0"; } else { channeltype = "1"; } int userid = UserHelper.CurrentUserId(); IsParentCompanyUser = new B2bCompanyManagerUserData().IsParentCompanyUser(userid); if (IsParentCompanyUser == false)//如果是门市账户 { B2b_company_manageuser user = B2bCompanyManagerUserData.GetUser(userid); channelcompanyid = user.Channelcompanyid.ToString(); } }
/// <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; } } }
public static string LoadingList(string comid, int pageindex, int pagesize, int userid) { var totalcount = 0; try { var list = new List <Member_Activity_Log>(); B2b_company_manageuser userr = B2bCompanyManagerUserData.GetUser(userid); if (userr != null) { if (userr.Channelcompanyid == 0)//总公司账户 { list = new B2bCrmData().LoadingList(comid, pageindex, pagesize, out totalcount); } else //总公司下面渠道 { list = new B2bCrmData().LoadingList(comid, pageindex, pagesize, int.Parse(userr.Channelcompanyid.ToString()), out totalcount); } IEnumerable result = ""; var memcompany = new MemberChannelcompanyData(); if (list != null) { result = from pro in list select new { ID = pro.ID, CardID = MemberCardData.GetCardId(pro.CardID).Cardcode.ToString(), //CardID =pro.CardID, ACTID = MemberActivityData.GetActById(pro.ACTID).Title.ToString(), OrderId = pro.OrderId, ServerName = pro.ServerName, Sales_admin = pro.Sales_admin, Num_people = pro.Num_people, Usesubdate = pro.Usesubdate, Per_capita_money = pro.Per_capita_money * pro.Num_people, Member_return_money = pro.Member_return_money, username = B2bCrmData.GetCrmCardcode(MemberCardData.GetCardId(pro.CardID).Cardcode) == null ? "--" : B2bCrmData.GetCrmCardcode(MemberCardData.GetCardId(pro.CardID).Cardcode).Name.ToString(), channel = memcompany.UpCompanyById(MemberCardData.GetCardId(pro.CardID).Cardcode.ToString()) } } ; return(JsonConvert.SerializeObject(new { type = 100, totalCount = totalcount, msg = result })); } else { return(JsonConvert.SerializeObject(new { type = 1, msg = "" })); } } catch (Exception ex) { return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message })); throw; } }
public static string FindPass(string account, string phone, string findway) { string message; string content = "您账户密码重置成功,新密码:$pass$,请登陆后更改密码!"; int userid = 0; if (findway == "") { findway = "sms"; } //判断登录账户是否存在 B2b_company_manageuser model2 = B2bCompanyManagerUserData.GetManageUserByAccount(account); if (model2 == null) { return(JsonConvert.SerializeObject(new { type = 1, msg = "账户与手机匹配错误!" })); } if (phone.Trim() == "") { return(JsonConvert.SerializeObject(new { type = 1, msg = "手机信息错误!" })); } if (phone.Trim() != model2.Tel.Trim()) { return(JsonConvert.SerializeObject(new { type = 1, msg = "账户与手机匹配错误!" })); } if (findway == "sms") { //短信重置密码 Random ra = new Random(); string newPass = ra.Next(26844521, 98946546).ToString(); var uppass = B2bCompanyManagerUserData.ChangePwd(model2.Id, model2.Passwords, newPass, out message); if (uppass == 0) { return(JsonConvert.SerializeObject(new { type = 1, msg = "重置密码错误!" })); } content = content.Replace("$pass$", newPass); var backContent = SendSmsHelper.SendSms(phone, content, model2.Com_id, out message); if (backContent < 0) { return(JsonConvert.SerializeObject(new { type = 1, msg = "重置短信发送失败,请重新重置密码!" })); } } if (findway == "email") { //邮件重置密码连接 //尚未做 } return(JsonConvert.SerializeObject(new { type = 100, msg = "密码重置成功" })); }
public int md_subscribenum = 0; //门店关注总数 protected void Page_Load(object sender, EventArgs e) { //图片上传 绑定控件 headPortrait.uploadFileInfo.ObjType = (int)FileObjType.Photo; headPortrait.displayImgId = "headPortraitImg"; channelcompanytype = Request["channelcompanytype"].ConvertTo <string>("inner"); int userid = UserHelper.CurrentUserId(); IsParentCompanyUser = new B2bCompanyManagerUserData().IsParentCompanyUser(userid); if (IsParentCompanyUser == false)//如果是门市账户 { B2b_company_manageuser user = B2bCompanyManagerUserData.GetUser(userid); if (user != null) { channelcompanyid = user.Channelcompanyid.ToString(); } Member_Channel_company ccompay = new MemberChannelcompanyData().GetChannelCompany(channelcompanyid); if (ccompay != null) { if (ccompay.Issuetype == 0) { channelcompanytype = "inner"; } if (ccompay.Issuetype == 1) { channelcompanytype = "out"; } } } //根据登录公司显示门店关注总数 md_subscribenum = new WxSubscribeDetailData().GetMd_Subscribenum(UserHelper.CurrentCompany.ID); isrun = Request["isrun"].ConvertTo <string>("1,0"); if (!IsPostBack) { hid_key.Value = ""; if (channelcompanytype == "inner") //如果是 所属门店/合作单位,则需要把总公司信息加上 { DataSet ds1 = GetHeadOffice(); //得到总公司信息 DataSet ds2 = GetAllTerms(channelcompanytype, channelcompanyid); ds1.Merge(ds2, false, MissingSchemaAction.Ignore); GridView2.DataSource = ds1;//获得 渠道单位 列表 GridView2.DataBind(); } else { GridView2.DataSource = GetAllTerms(channelcompanytype, channelcompanyid);//获得 渠道单位 列表 GridView2.DataBind(); } } }
internal List <Wxqunfa_log> GetQunfalist(int comid, int userid, int pageindex, int pagesize, out int totalcount) { var condition = ""; //得到员工全部信息 B2b_company_manageuser model = new B2bCompanyManagerUserData().GetCompanyUser(userid); if (model != null) { if (model.Channelcompanyid == 0)//公司员工,显示公司群发记录 { condition = " userid in (select id from b2b_company_manageuser where com_id=" + comid + " and channelcompanyid=0)"; } else //门店员工,显示门店群发记录 { condition = " userid in (select id from b2b_company_manageuser where com_id=" + comid + " and channelcompanyid=" + model.Channelcompanyid + ")"; } } else { totalcount = 0; return(null); } var cmd = this.sqlHelper.PrepareStoredSqlCommand("proc_ListPage"); cmd.PagingCommand1("wxqunfa_log", "*", "id desc", "", pagesize, pageindex, "", condition); List <Wxqunfa_log> list = new List <Wxqunfa_log>(); using (var reader = cmd.ExecuteReader()) { while (reader.Read()) { list.Add(new Wxqunfa_log() { Id = reader.GetValue <int>("id"), Msgtype = reader.GetValue <string>("msgtype"), Media_id = reader.GetValue <string>("media_id"), Content = reader.GetValue <string>("content"), Sendtime = reader.GetValue <DateTime>("sendtime"), Errcode = reader.GetValue <int>("errcode"), Errmsg = reader.GetValue <string>("errmsg"), Msg_id = reader.GetValue <string>("msg_id"), Userid = reader.GetValue <int>("userid"), Channelcompanyid = reader.GetValue <int>("channelcompanyid"), Comid = reader.GetValue <int>("comid"), Yearmonth = reader.GetValue <string>("yearmonth"), Yearmonthday = reader.GetValue <string>("yearmonthday"), Weixins = reader.GetValue <string>("weixins") }); } } totalcount = int.Parse(cmd.Parameters[0].Value.ToString()); return(list); }
internal List <B2b_invitecodesendlog> Getinvitecodesendlog(int comid, int userid, int pageindex, int pagesize, out int totalcount) { var condition = ""; //得到员工全部信息 B2b_company_manageuser model = new B2bCompanyManagerUserData().GetCompanyUser(userid); if (model != null) { if (model.Channelcompanyid == 0)//公司员工,显示公司群发记录 { condition = " senduserid in (select id from b2b_company_manageuser where com_id=" + comid + " and channelcompanyid=0)"; } else //门店员工,显示门店群发记录 { condition = " senduserid in (select id from b2b_company_manageuser where com_id=" + comid + " and channelcompanyid=" + model.Channelcompanyid + ")"; } } else { totalcount = 0; return(null); } var cmd = this.sqlHelper.PrepareStoredSqlCommand("proc_ListPage"); cmd.PagingCommand1("b2b_invitecodesendlog", "*", "id desc", "", pagesize, pageindex, "", condition); List <B2b_invitecodesendlog> list = new List <B2b_invitecodesendlog>(); using (var reader = cmd.ExecuteReader()) { while (reader.Read()) { list.Add(new B2b_invitecodesendlog() { Id = reader.GetValue <int>("id"), Phone = reader.GetValue <string>("Phone"), Smscontent = reader.GetValue <string>("Smscontent"), Invitecode = reader.GetValue <string>("Invitecode"), Senduserid = reader.GetValue <int>("Senduserid"), Sendtime = reader.GetValue <DateTime>("Sendtime"), Issendsuc = reader.GetValue <int>("Issendsuc"), Isqunfa = reader.GetValue <int>("Isqunfa"), Remark = reader.GetValue <string>("Remark"), Comid = reader.GetValue <int>("comid") }); } } totalcount = int.Parse(cmd.Parameters[0].Value.ToString()); return(list); }
public static string WhetherEditByIdJson(int actid, int operuserid) { Member_Activity model = new MemberActivityData().GetMemberActivityById(actid); if (model == null) { return(JsonConvert.SerializeObject(new { type = 100, msg = "获取优惠活动失败", data = "0" })); } else { //获得操作人信息 B2b_company_manageuser user = B2bCompanyManagerUserData.GetUser(operuserid); if (user != null) { if (model.Com_id == user.Com_id) { if (model.CreateUserId == 0) //由于以前活动表中没有createuserid,所以createuserid=0认定为公司创建 { if (user.Channelcompanyid == 0) //操作人属于公司,可以编辑活动 { return(JsonConvert.SerializeObject(new { type = 100, msg = "", data = "1" })); } else { return(JsonConvert.SerializeObject(new { type = 100, msg = "", data = "0" })); } } else { //判断创建人和现在的操作人是否属于同一单位(同一门市或者同一公司下) bool whethersameunit = new MemberActivityData().WhetherSameunit(model.CreateUserId, user.Channelcompanyid); if (whethersameunit) { return(JsonConvert.SerializeObject(new { type = 100, msg = "", data = "1" })); } else { return(JsonConvert.SerializeObject(new { type = 100, msg = "", data = "0" })); } } } else { return(JsonConvert.SerializeObject(new { type = 100, msg = "活动非本公司活动", data = "0" })); } } else { return(JsonConvert.SerializeObject(new { type = 100, msg = "获取操作人信息失败", data = "0" })); } } }
public static string ActPageList(string comid, int pageindex, int pagesize, int userid = 0, string state = "0,1") { //活动过期 TimeSpan ts = new TimeSpan(0, 0, 0, 0, 0); //DateTime dt2 = DateTime.Now.Subtract(ts); //string msg= DateTime.Now.ToString() + "-" + ts.Days.ToString() + "天/r/n"; //msg += dt2.ToString(); var totalcount = 0; try { var manageuserdata = new B2bCompanyManagerUserData(); var actdata = new MemberActivityData(); var list = actdata.ActPageList(comid, pageindex, pagesize, out totalcount, state); IEnumerable result = ""; if (list != null) { result = from pro in list select new { Id = pro.Id, Title = pro.Title, Actstar = pro.Actstar, Actend = pro.Actend, Acttype = pro.Acttype, Cashback = pro.Cashback, CashFull = pro.CashFull, Com_id = pro.Com_id, Discount = pro.Discount, Money = pro.Money, RepeatIssue = pro.RepeatIssue, ReturnAct = pro.ReturnAct, UseOnceUseOnce = pro.UseOnce, FaceObjects = pro.FaceObjects, Runstate = pro.Runstate, ExpiryDate = DateTime.Now < pro.Actend ? "未过期" : "已过期", Whetheredit = WhetherEditByIdStr(pro.Id, userid) == "1"?"yes":"no", CreateChannel = manageuserdata.GetCompanynamebyUserid(pro.CreateUserId) } } ; return(JsonConvert.SerializeObject(new { type = 100, totalCount = totalcount, msg = result })); } catch (Exception ex) { return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message })); throw; } }
public static string WhetherEditByIdStr(int actid, int operuserid) { Member_Activity model = new MemberActivityData().GetMemberActivityById(actid); if (model == null) { return("0"); } else { //获得操作人信息 B2b_company_manageuser user = B2bCompanyManagerUserData.GetUser(operuserid); if (user != null) { if (model.Com_id == user.Com_id) { if (model.CreateUserId == 0) //由于以前活动表中没有createuserid,所以createuserid=0认定为公司创建 { if (user.Channelcompanyid == 0) //操作人属于公司,可以编辑活动 { return("1"); } else { return("0"); } } else { //判断创建人和现在的操作人是否属于同一单位(同一门市或者同一公司下) bool whethersameunit = new MemberActivityData().WhetherSameunit(model.CreateUserId, user.Channelcompanyid); if (whethersameunit) { return("1"); } else { return("0"); } } } else { return("0"); } } else { return("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 })); } }
public static string MasterpagelistByComId(string employstate, int pageindex, int pagesize, string comid, int userid, string key = "") { var totalcount = 0; var memberdata = new MemberChannelData(); MemberChannelcompanyData channel = new MemberChannelcompanyData(); try { var list = new B2bCompanyManagerUserData().Manageuserpagelist(employstate, comid, pageindex, pagesize, out totalcount, userid, key); IEnumerable result = ""; if (list != null) { result = from model in list select new { model.Id, Accounts = model.Accounts, PassWord = model.Passwords, MasterId = model.Id, MasterName = model.Employeename, CompanyName = channel.GetCompanyById(Int32.Parse(model.Channelcompanyid.ToString())) != null?channel.GetCompanyById(Int32.Parse(model.Channelcompanyid.ToString())).Companyname : "", Tel = model.Tel, GroupName = new Sys_MasterGroupData().GetGroupNameStrByMasterId(model.Id), Employstate = model.Employeestate, weixinstate = memberdata.GetChannelListByComidState(int.Parse(comid), model.Id), Peoplelistview = model.Peoplelistview, Workdays = model.Workdays, Isdefaultkf = model.Isdefaultkf, Channelid = new MemberChannelData().GetChannelid(model.Com_id, model.Tel), //渠道id rebatenum = new Member_channel_rebatelogData().Getrebatenum(model.Com_id, model.Tel), //返佣次数 rebateapplytotal = new Member_channel_rebateApplylogData().Getrebateapplytotal(model.Com_id, model.Tel), //返佣申请总额 rebatehastixian = new Member_channel_rebateApplylogData().Getrebatehastixian(model.Com_id, model.Tel), //返佣申请已提现金额 rebatenottixian = new Member_channel_rebateApplylogData().Getrebatenottixian(model.Com_id, model.Tel), //返佣申请尚未提现金额 restrebate = new MemberChannelData().Getrestrebate(model.Com_id, model.Tel), //剩余可申请返佣金额 } } ; return(JsonConvert.SerializeObject(new { type = 100, totalCount = totalcount, msg = result })); } catch (Exception ex) { return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message })); throw; } }
public static string Adjustemploerstate(int masterid, int employerstate) { try { int result = new B2bCompanyManagerUserData().Adjustemploerstate(masterid, employerstate); return(JsonConvert.SerializeObject(new { type = 100, msg = result })); } catch (Exception ex) { return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message })); throw; } }
internal static string GetCompanyIdByUserId(string userid) { string companyid = "0"; //判断用户是否是管理员,如是管理员,不对用户渠道公司限制 Sys_Group sysgroup = new Sys_GroupData().GetGroupByUserId(int.Parse(userid)); if (sysgroup.Groupid != 1)//不是管理员 { //根据userid得到用户信息,如果用户没有渠道公司的分配,则显示全部门市 B2b_company_manageuser muser = B2bCompanyManagerUserData.GetUser(int.Parse(userid)); companyid = muser.Channelcompanyid.ToString(); } return(companyid); }
public int ishaslvyoubusproorder = 0; //是否含有 旅游大巴产品订单 protected void Page_Load(object sender, EventArgs e) { if (UserHelper.ValidateLogin()) { int userid = UserHelper.CurrentUserId(); IsParentCompanyUser = new B2bCompanyManagerUserData().IsParentCompanyUser(userid); if (IsParentCompanyUser == false)//如果是门市账户 { B2b_company_manageuser user = B2bCompanyManagerUserData.GetUser(userid); channelcompanyid = user.Channelcompanyid.ToString(); } //ishaslvyoubusproorder = new B2bComProData().IsHasLvyoubusPro(UserHelper.CurrentCompany.ID, (int)ProductServer_Type.LvyouBus); ishaslvyoubusproorder = new B2bOrderData().IsHasLvyoubusProOrder(UserHelper.CurrentCompany.ID, (int)ProductServer_Type.LvyouBus); } }
public static string ChangePwd(int userid, string oldpwd, string pwd1) { try { string message = ""; int changepwd = B2bCompanyManagerUserData.ChangePwd(userid, oldpwd, pwd1, out message); if (changepwd == 0) { return(JsonConvert.SerializeObject(new { type = 1, msg = message })); } return(JsonConvert.SerializeObject(new { type = 100, msg = message })); } catch (Exception ex) { return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message })); } }
public string channelsource = "0"; //渠道类型(0:内部门店;1:合作公司) protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { statistics = Request.QueryString["statistics"].ConvertTo <string>(""); if (statistics == "") { Response.Write("<script>alert('渠道单位不存在');location.href='Channelstatistics.aspx'</script>"); } int userid = UserHelper.CurrentUserId(); IsParentCompanyUser = new B2bCompanyManagerUserData().IsParentCompanyUser(userid); if (IsParentCompanyUser == false)//如果是门市账户 { B2b_company_manageuser user = B2bCompanyManagerUserData.GetUser(userid); channelsource = user.Channelsource.ToString(); } } }
public static string GetManageUserByAccount(string account) { try { B2b_company_manageuser manageruser = B2bCompanyManagerUserData.GetManageUserByAccount(account); if (manageruser == null) { return(JsonConvert.SerializeObject(new { type = 1, msg = "null" })); } else { var list = new List <B2b_company_manageuser>(); list.Add(manageruser); IEnumerable result = ""; if (list != null) { result = from model in list select new { Accounts = model.Accounts, PassWord = model.Passwords, MasterId = model.Id, MasterName = model.Employeename, CompanyName = B2bCompanyData.GetCompanyByUid(model.Id).Com_name, Tel = model.Tel, GroupNames = new Sys_MasterGroupData().GetGroupNameStrByMasterId(model.Id), GroupIds = new Sys_MasterGroupData().GetGroupIdStrByMasterId(model.Id), ChannelCompanyId = model.Channelcompanyid, ChannelCompanyName = model.Channelcompanyid == 0 ? "全部渠道" : new MemberChannelcompanyData().GetCompanyById(model.Channelcompanyid.ToString().ConvertTo <int>(0)).Companyname, Channelsource = model.Channelsource } } ; return(JsonConvert.SerializeObject(new { type = 100, msg = result })); } } catch (Exception ex) { return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message })); } }
public static string GetManageUserInfo(int userid) { try { B2b_company_manageuser manageruser = B2bCompanyManagerUserData.GetUser(userid); if (manageruser == null) { return(JsonConvert.SerializeObject(new { type = 1, msg = "null" })); } else { return(JsonConvert.SerializeObject(new { type = 100, msg = manageruser })); } } catch (Exception ex) { return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message })); } }
private static string GetOpertor(string userid) { if (userid.ConvertTo <int>(0) == 0) { return(userid); } else { B2b_company_manageuser u = new B2bCompanyManagerUserData().GetCompanyUser(userid.ConvertTo <int>()); if (u != null) { return(u.Employeename); } else { return(userid); } } }
//设定员工所在分组 public static bool SetMasterGroup(string masterid, string groupname, out string msg) { B2b_company_manageuser user = B2bCompanyManagerUserData.GetUser(int.Parse(masterid)); if (user == null) { msg = "账户信息获取为空"; return(false); } else { string mastername = user.Employeename; Sys_Group group = new Sys_GroupData().GetGroupByName(groupname.Trim()); if (group == null) { msg = "管理组获取为空"; return(false); } else { string grouparr = group.Groupid.ToString(); int createmasterid = 0; string createmastername = "开户后系统自动创建"; DateTime createdate = DateTime.Now; int count = new Sys_MasterGroupData().EditMasterGroup(masterid, mastername, grouparr, createmasterid, createmastername, createdate); if (count > 0) { msg = ""; return(true); } else { msg = "设定账户权限失败"; return(false); } } } }