/// <summary> /// 编辑身份验证项目 /// </summary> public void Verified_Edit() { if (!Power("supplier_verified", "身份验证")) { AjaxNoPower(); return; } int id = RequestTool.RequestInt("id", 0); int Type_id_BillType = RequestTool.RequestInt("Type_id_BillType", 0); bool addflag = false; string where = ""; where = "Verified_id = " + id + " and Supplier_id = " + CurrentSupplier.id + ""; Lebi_Supplier_Verified Verified = B_Lebi_Supplier_Verified.GetModel(id); if (Verified == null) { Verified = new Lebi_Supplier_Verified(); } Lebi_Supplier_Verified_Log model = B_Lebi_Supplier_Verified_Log.GetModel(where); if (model == null) { addflag = true; model = new Lebi_Supplier_Verified_Log(); } model = B_Lebi_Supplier_Verified_Log.SafeBindForm(model); model.Type_id_SupplierVerifiedStatus = 9020; model.Time_Add = DateTime.Now; if (addflag) { model.Verified_id = id; model.Supplier_id = CurrentSupplier.id; B_Lebi_Supplier_Verified_Log.Add(model); id = B_Lebi_Supplier_Verified_Log.GetMaxId(); Log.Add("身份验证", "Supplier_Verified", id.ToString(), CurrentSupplier, Lang(Verified.Name)); } else { B_Lebi_Supplier_Verified_Log.Update(model); Log.Add("身份验证", "Supplier_Verified", id.ToString(), CurrentSupplier, Lang(Verified.Name)); } string result = "{\"msg\":\"OK\", \"id\":\"" + id + "\"}"; Response.Write(result); }
/// <summary> /// 用户这注册 /// </summary> public void User_Reg() { string verifycode = RequestTool.RequestString("verifycode"); string code = CurrentCheckCode; string UserName = RequestTool.RequestSafeString("UserName"); //检查用户名存在 if (CurrentUser.id == 0 || CurrentUser.IsAnonymous == 1) { Response.Write("{\"msg\":\"" + Tag("请登录") + "\"}"); return; } if (SYS.Verifycode_SupplierRegister == "1") { if (code != verifycode) { Response.Write("{\"msg\":\"" + Tag("验证码错误") + "\"}"); return; } } //检查用户名存在 int count = B_Lebi_Supplier.Counts("UserName !='' and UserName=lbsql{'" + CurrentUser.UserName + "'}"); if (count > 0) { Response.Write("{\"msg\":\"" + Tag("商家已注册") + "\"}"); return; } Lebi_Supplier model = B_Lebi_Supplier.GetModel("User_id=" + CurrentUser.id + ""); if (model == null) { model = new Lebi_Supplier(); } Lebi_Supplier_Group group = B_Lebi_Supplier_Group.GetModel(RequestTool.RequestInt("Supplier_Group_id")); if (group == null) { Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}"); return; } B_Lebi_Supplier.SafeBindForm(model); model.User_id = CurrentUser.id; model.UserName = CurrentUser.UserName; model.Email = RequestTool.RequestSafeString("Email"); model.RealName = RequestTool.RequestSafeString("RealName"); model.Company = RequestTool.RequestSafeString("Company"); model.Name = RequestTool.RequestSafeString("Name"); model.Name = "[{\"L\":\"" + Language.DefaultLanguage().Code + "\",\"C\":\"" + model.Name + "\"}]"; model.SubName = RequestTool.RequestSafeString("SubName"); model.MobilePhone = RequestTool.RequestSafeString("MobilePhone"); model.Phone = RequestTool.RequestSafeString("Phone"); model.QQ = RequestTool.RequestSafeString("QQ"); model.Language = CurrentLanguage.Code; model.Time_Reg = DateTime.Now; model.Time_This = DateTime.Now; model.Time_Last = DateTime.Now; model.Count_Login = 1; model.IP_This = RequestTool.GetClientIP(); model.IP_Last = RequestTool.GetClientIP(); model.Type_id_SupplierStatus = 441; model.BillingDays = group.BillingDays; model.Money_Service = group.ServicePrice; model.Money_Margin = group.MarginPrice; model.Time_Begin = DateTime.Now; model.Time_End = DateTime.Now.AddDays(group.ServiceDays); if (model.id == 0) { B_Lebi_Supplier.Add(model); model.id = B_Lebi_Supplier.GetMaxId(); } else { B_Lebi_Supplier.Update(model); } if (group.Verified_ids != "") { List <Lebi_Supplier_Verified> models = B_Lebi_Supplier_Verified.GetList("id in (" + group.Verified_ids + ")", "Sort desc"); foreach (Lebi_Supplier_Verified m in models) { string where = "Verified_id = " + m.id + " and Supplier_id = " + model.id + ""; Lebi_Supplier_Verified_Log log = B_Lebi_Supplier_Verified_Log.GetModel(where); if (log == null) { log = new Lebi_Supplier_Verified_Log(); } //log = B_Lebi_Supplier_Verified_Log.SafeBindForm(log); log.ImageUrl = RequestTool.RequestSafeString("Image" + m.id); log.Type_id_SupplierVerifiedStatus = 9020; log.Time_Add = DateTime.Now; log.Verified_id = m.id; log.Supplier_id = model.id; if (log.id == 0) { B_Lebi_Supplier_Verified_Log.Add(log); } else { B_Lebi_Supplier_Verified_Log.Update(log); } } } EX_Supplier.SupplierRegister(model);//触发事件 Response.Write("{\"msg\":\"OK\"}"); }