/// <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 B2b_company GetqunarbyQunarname(string supplierIdentity) { using (var helper = new SqlHelper()) { B2b_company m = new InternalB2bCompany(helper).GetqunarbyQunarname(supplierIdentity); return(m); } }
public int Getmicromallimgbycomid(int comid) { using (var helper = new SqlHelper()) { int m = new InternalB2bCompany(helper).Getmicromallimgbycomid(comid); return(m); } }
public int Insmicroimg(int comid, int micromallimgid) { using (var helper = new SqlHelper()) { int m = new InternalB2bCompany(helper).Insmicroimg(comid, micromallimgid); return(m); } }
public B2b_company GetMicromallByComid(int comid) { using (var helper = new SqlHelper()) { B2b_company m = new InternalB2bCompany(helper).GetMicromallByComid(comid); return(m); } }
public int GetBindingAgentByComid(int comid) { using (var helper = new SqlHelper()) { int m = new InternalB2bCompany(helper).GetBindingAgentByComid(comid); return(m); } }
public List <B2b_company> Getcompanylist(string isapicompany = "0,1") { using (var helper = new SqlHelper()) { List <B2b_company> m = new InternalB2bCompany(helper).Getcompanylist(isapicompany); return(m); } }
public int Editqunarbycomid(int comid, int isqunar, string qunar_username, string qunar_pass) { using (var helper = new SqlHelper()) { var r = new InternalB2bCompany(helper).Editqunarbycomid(comid, isqunar, qunar_username, qunar_pass); return(r); } }
//得到商户当天的 随机码 public string GetComDayRandomstr(int comid, string posid, int randomnum = 3) { using (var sql = new SqlHelper()) { var internalData = new InternalB2bCompany(sql); var result = internalData.GetComDayRandomstr(comid, posid, randomnum); return(result); } }
public List <B2b_company> GetAllCompanys(string comstate, out int firsttotalcount) { using (var sql = new SqlHelper()) { var internalData = new InternalB2bCompany(sql); var result = internalData.GetAllCompanys(comstate, out firsttotalcount); return(result); } }
public List <B2b_company_nowdayrandom> GetComDayRandomlist(int comid, DateTime searchdate, int randomnum = 3) { using (var sql = new SqlHelper()) { var internalData = new InternalB2bCompany(sql); var result = internalData.GetComDayRandomlist(comid, searchdate, randomnum); return(result); } }
public static string GetComWebLogo(int comid) { using (var sql = new SqlHelper()) { var internalData = new InternalB2bCompany(sql); var result = internalData.GetComWebLogo(comid); return(result); } }
//生成当天的随机码(循环24次,每次都循环查一次,没有才插入,手工生成码) public int CreateComDayRandom(int comid, DateTime searchdate, int randomnum = 3) { using (var sql = new SqlHelper()) { var internalData = new InternalB2bCompany(sql); var result = internalData.CreateComDayRandom(comid, searchdate, randomnum); return(result); } }
public int ChangeComType(int comid, int hangye) { using (var sql = new SqlHelper()) { var internalData = new InternalB2bCompany(sql); var result = internalData.ChangeComType(comid, hangye); return(result); } }
public B2b_company GetCompanyBasicById(int comid) { using (var sql = new SqlHelper()) { var internalData = new InternalB2bCompany(sql); var result = internalData.GetCompanyBasicById(comid); return(result); } }
/// <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; } } }
public static int GetAllComMsgbyphone(string phone) { using (var sql = new SqlHelper()) { try { var internalData = new InternalB2bCompany(sql); var com = internalData.GetAllComMsgbyphone(phone); return(com); } catch { throw; } } }
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; } } }
public static B2b_company_info AdminDomainGetComId(string domain) { using (var sql = new SqlHelper()) { try { var internalData = new InternalB2bCompany(sql); B2b_company_info com = internalData.AdminDomainGetComId(domain); return(com); } catch { throw; } } }
public List <B2b_company> ComList(int pageindex, int pagesize, out int totalcount) { using (var sql = new SqlHelper()) { try { var internalData = new InternalB2bCompany(sql); var result = internalData.ComList(pageindex, pagesize, out totalcount); return(result); } catch { throw; } } }
public string UpCom(int comid, int id, string state) { using (var sql = new SqlHelper()) { try { var internalData = new InternalB2bCompany(sql); var result = internalData.UpCom(comid, id, state); return(result); } catch { throw; } } }
/// <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; } } }
public string Agent_Open_Comid(int comid, int agentid, DateTime opendate, DateTime enddate) { using (var sql = new SqlHelper()) { try { var internalData = new InternalB2bCompany(sql); var result = internalData.Agent_Open_Comid(comid, agentid, opendate, enddate); return(result); } catch { throw; } } }
public int AdjustServiceFee(string id, decimal ServiceFee) { using (var sql = new SqlHelper()) { try { var internalData = new InternalB2bCompany(sql); var result = internalData.AdjustServiceFee(id, ServiceFee); return(result); } catch { throw; } } }
public static B2b_company GetAllComMsg(int comid) { using (var sql = new SqlHelper()) { try { var internalData = new InternalB2bCompany(sql); B2b_company com = internalData.GetCompany(comid); if (com != null) { com.B2bcompanyinfo = new InternalB2bCompanyInfo(sql).GetCompanyInfo(comid); } return(com); } catch { throw; } } }
public static B2b_company SearchUnopenCom(string key) { using (var sql = new SqlHelper()) { try { var internalData = new InternalB2bCompany(sql); B2b_company com = internalData.SearchUnopenCom(key); if (com != null) { com.B2bcompanyinfo = new InternalB2bCompanyInfo(sql).GetCompanyInfo(com.ID); } return(com); } catch { throw; } } }
/// <summary> /// 编辑商家信息 by:xiaoliu /// </summary> /// <param name="b2b_company"></param> /// <param name="B2b_Company_Info"></param> /// <param name="manageuser"></param> /// <returns></returns> public static string InsertOrUpdateB2bCompany(B2b_company b2b_company, B2b_company_info B2b_Company_Info) { try { using (var sql = new SqlHelper()) { var internalb2bcompany = new InternalB2bCompany(sql); var companyid = internalb2bcompany.InsertOrUpdate(b2b_company); var internalb2bcompanyinfo = new InternalB2bCompanyInfo(sql); var companyinfoid = internalb2bcompanyinfo.InsertOrUpdate(B2b_Company_Info); return(JsonConvert.SerializeObject(new { type = 100, msg = companyid })); } } catch { new SqlHelper().Dispose(); throw; } }