/// <summary> /// 收货地址列表 /// </summary> /// <returns></returns> public ActionResult AddressList() { if (System.Web.HttpContext.Current.Request.Cookies[":userlogin"] == null || System.Web.HttpContext.Current.Request.Cookies[":userlogin"].Value == "") { return View("/sswLogin/Login"); } else { mimodel = CookieEncrypt.DeserializeObject(System.Web.HttpContext.Current.Request.Cookies[":userlogin"].Value) as MemberBase; var list = _consigneeInfoBase.GetModelList(" c_StatusCode = 0 and c_IsDel = 0 and m_ID = " + mimodel.m_ID); if (list != null && list.Any()) { ViewData["addressList"] = list; return View(); } else { ViewData["addressList"] = null; return View(); } } //if (LoginMember == null) //{ // Response.Redirect("/wapLogin/Login", true); //} //else //{ //} }
/// <summary> /// 保存 /// </summary> public string SaveRegister() { string result = ""; string name = RequestBase.GetString("name"); string pwd = RequestBase.GetString("pwd"); string phone = RequestBase.GetString("phone"); string email = RequestBase.GetString("email"); string yyzz = RequestBase.GetString("yyzz"); if (name.Trim().Length < 6) { result += "用户名不能小于6位<br>"; } if (pwd.Trim().Length < 6 || pwd.Trim().Length > 20) { result += "密码必须为6-20位字符串<br>"; } if (!RegexHelper.IsPhone(phone)) { result += "电话号码格式不正确!<br>"; } if (!RegexHelper.IsEmail(email)) { result += "邮箱格式不正确!<br>"; } if (string.IsNullOrWhiteSpace(result)) { try { Model.MemberBase member = new Model.MemberBase(); member.m_UserName = name; member.m_Password = Utils.MD5(pwd); member.m_Email = email; member.m_Phone = phone; member.m_Score = 0; member.m_Rank = 1; member.m_ZheK = 1; member.m_StatusCode = 0; member.m_ShenPstatus = 1; if (!string.IsNullOrWhiteSpace(yyzz)) { member.m_YingYZZ = yyzz; member.m_UserType = 2; } if (_member.Add(member) == 0) { result = "注册失败!"; } } catch { result = "注册失败!"; } } return result; }
//注册成功页面 验证邮箱页面 // GET: /RegisterSuccessMail/ public ActionResult RegisterSuccessPage() { string successname = RequestBase.GetString("username"); string successusertype = RequestBase.GetString("usertype"); if (LoginMember != null) { ViewData["IsLogin"] = true; } else { ViewData["IsLogin"] = false; } if (successname != null && successname != "" && successusertype == "0") { BLL.MemberBase mbbll = new BLL.MemberBase(); DataSet ds = mbbll.GetList(" m_UserName='******' and m_UserType=0"); string id = ds.Tables[0].Rows[0]["m_ID"].ToString(); Model.MemberBase mbmodel = new Model.MemberBase(); mbmodel = mbbll.GetModel(int.Parse(id)); mbmodel.m_StatusCode = 0; mbmodel.m_mailyanzheng = true; if (mbbll.Update(mbmodel)) { ViewData["ueername"] = "恭喜您," + successname + ",邮箱验证成功!"; return View(); } else { ViewData["ueername"] = successname + ",数据异常,邮箱验证失败,请联系管理员!"; return View(); } } else { BLL.MemberBase mbbll = new BLL.MemberBase(); DataSet ds = mbbll.GetList(" m_UserName='******' and m_UserType=2"); string id = ds.Tables[0].Rows[0]["m_ID"].ToString(); Model.MemberBase mbmodel = new Model.MemberBase(); mbmodel = mbbll.GetModel(int.Parse(id)); mbmodel.m_StatusCode = 0; mbmodel.m_ShenPstatus = 1; if (mbbll.Update(mbmodel)) { ViewData["ueername"] = "恭喜您," + successname + ",邮箱验证成功!"; return View(); } else { ViewData["ueername"] = successname + ",数据异常,邮箱验证失败,请联系管理员!"; return View(); } } }
// // GET: /AccountManage/ /// <summary> /// 账户管理-账户资料页面 /// </summary> /// <returns></returns> public ActionResult vipAccountData() { //Model.MemberBase mbmodel = new Model.MemberBase(); //mbmodel=mbbll.GetModel(2); //if (mbmodel.m_Provice != null && mbmodel.m_City != null && mbmodel.m_Count != null) int mid = 0; if (LoginMember != null) { mid = (CookieEncrypt.DeserializeObject(System.Web.HttpContext.Current.Request.Cookies["UserInfo"].Value) as Model.MemberBase).m_ID; Model.MemberBase mbmodel = new Model.MemberBase(); mbmodel = mbbll.GetModel(mid); #region 绑定居住地址 if (mbmodel.m_Provice != null && mbmodel.m_City != null && mbmodel.m_Count != null) { var modelList = _regionBase.GetModelList(" reg_PId = 0"); List<SelectListItem> selectType = new List<SelectListItem>(); selectType = new List<SelectListItem> { new SelectListItem { Text = "请选择", Value = "chose" } }; foreach (var model in modelList) { selectType.Add(new SelectListItem { Value = model.reg_Code.ToString(), Text = model.reg_Name }); } var modelList2 = _regionBase.GetModelList(" reg_PId=" + mbmodel.m_Provice); List<SelectListItem> selectType2 = new List<SelectListItem>(); selectType2 = new List<SelectListItem> { new SelectListItem { Text = "请选择", Value = "chose" } }; foreach (var model in modelList2) { selectType2.Add(new SelectListItem { Value = model.reg_Code.ToString(), Text = model.reg_Name }); } var modelList3 = _regionBase.GetModelList(" reg_PId=" + mbmodel.m_City); List<SelectListItem> selectType3 = new List<SelectListItem>(); selectType3 = new List<SelectListItem> { new SelectListItem { Text = "请选择", Value = "chose" } }; foreach (var model in modelList3) { selectType3.Add(new SelectListItem { Value = model.reg_Code.ToString(), Text = model.reg_Name }); } ViewData["selectType"] = new SelectList(selectType, "Value", "Text", mbmodel.m_Provice); ViewData["selectType2"] = new SelectList(selectType2, "Value", "Text", mbmodel.m_City); ViewData["selectType3"] = new SelectList(selectType3, "Value", "Text", mbmodel.m_Count); } else { var modelList = _regionBase.GetModelList(" reg_PId = 0"); List<SelectListItem> selectType = new List<SelectListItem>(); selectType = new List<SelectListItem> { new SelectListItem { Text = "请选择", Value = "chose" } }; foreach (var model in modelList) { selectType.Add(new SelectListItem { Value = model.reg_Code.ToString(), Text = model.reg_Name }); } ViewData["selectType"] = new SelectList(selectType, "Value", "Text", "请选择"); List<SelectListItem> selectType2 = new List<SelectListItem>(); selectType2 = new List<SelectListItem> { new SelectListItem { Text = "请选择", Value = "chose" } }; ViewData["selectType2"] = new SelectList(selectType2, "Value", "Text", "请选择"); List<SelectListItem> selectType3 = new List<SelectListItem>(); selectType3 = new List<SelectListItem> { new SelectListItem { Text = "请选择", Value = "chose" } }; ViewData["selectType3"] = new SelectList(selectType3, "Value", "Text", "请选择"); } #endregion ViewData["sex"] = mbmodel.m_Sex; ViewData["headimg"] = mbmodel.m_HeadImg; return View(mbmodel); } else { Response.Redirect("/Logon/Logon"); return View(); } }
/// <summary> /// 企业会员注册方法 /// </summary> /// <returns></returns> public ActionResult companyRegisterAdd() { string username = Request.Form["email"]; string password = Request.Form["password"]; //转换md5 string md5password = Utils.MD5(password); string lianxiren = Request.Form["lxname"]; string phone = Request.Form["phone"]; string lxemail = Request.Form["lxemail"]; string qq = Request.Form["qq"]; string gsname = Request.Form["gsname"]; string yyzz = Request.Form["yyzz"]; string xxdizhi = Request.Form["xxadress"]; //省份地区 int shengfen = Convert.ToInt32(Request.Form["selectType"]); int shi = Convert.ToInt32(Request.Form["selectType2"]); int quyu = Convert.ToInt32(Request.Form["selectType3"]); //固定电话 string quhao = Request.Form["quhao"]; string gdhaoma = Request.Form["gdhaoma"]; string fenji = Request.Form["fenji"]; string gudingdianhao = "";//固定电话 if (quhao != null && quhao != "") { gudingdianhao += quhao; } if (gdhaoma != null && gdhaoma != "") { gudingdianhao += gdhaoma; } if (fenji != null && fenji != "") { gudingdianhao += fenji; } try { Model.MemberBase mb = new Model.MemberBase(); mb.m_UserName = username; mb.m_Password = md5password; mb.m_RealName = lianxiren;//联系人 if (gudingdianhao != "") { mb.m_GDPhone = gudingdianhao; } mb.m_Phone = phone; mb.m_Email = lxemail; mb.m_QQ = qq; mb.m_GongSiName = gsname; mb.m_YingYZZ = yyzz; mb.m_Provice = shengfen; mb.m_City = shi; mb.m_Count = quyu; mb.m_GongSiAddress = xxdizhi; mb.m_Score = 0; mb.m_Rank = 1; mb.m_ZheK = 1; mb.m_UserType = 2; mb.m_StatusCode = 0; mb.m_ShenPstatus = 0; ////发送邮件 //string url = GetUrl(); //string mailAccount = ConfigurationManager.AppSettings["mailAccount"].ToString();//发送者邮箱 //string mima = ConfigurationManager.AppSettings["mailPassWord"].ToString();//发送者邮箱密码 //string mailShowName = ConfigurationManager.AppSettings["mailShowName"].ToString();//邮件主题 //string body = "欢迎注册月月兴企业会员!请点击<div><a href='http://" + url + "?username="******"&usertype=2'>月月兴验证</a>链接完成注册!</div>"; //if (MailMessageExtensions.SendMail(mailShowName, body, mailAccount, mb.m_Email, mima)) //{ Session["newcmid"]=new BLL.MemberBase().Add(mb); if (int.Parse(Session["newcmid"].ToString()) > 0) { Session["registerusername"] = username; Session["registeremail"] = lxemail; Session["usertype"] = "2"; return View("successRegiser" ); } else { return Content("<script>alert('注册失败,系统信息异常!');location.href='companyRegister'</script>"); } //} //else //{ // return Content("<script>alert('注册失败,您输入邮箱的不存在!');location.href='companyRegister'</script>"); //} } catch (Exception) { return Content("<script>alert('注册失败,系统异常!');location.href='companyRegister'</script>"); } }
/// <summary> /// 注册个人会员方法 /// </summary> /// <returns></returns> public ActionResult singleRegisterAdd() { string username = Request.Form["userName"]; string password = Request.Form["password"]; string md5password = Utils.MD5(password); string email = Request.Form["email"]; string phone = Request.Form["phone"]; try { Model.MemberBase mb = new Model.MemberBase(); mb.m_UserName = username; mb.m_Password = md5password; mb.m_Email = email; mb.m_Phone = phone; mb.m_Score = 0; mb.m_Rank = 1; mb.m_ZheK = 1; mb.m_StatusCode = 0; mb.m_ShenPstatus = 1; string url = GetUrl(); ////发送邮件 //string successemailpage=ConfigurationManager.AppSettings["RegisterSuccessPage"].ToString(); //string mailAccount = ConfigurationManager.AppSettings["mailAccount"].ToString();//发送者邮箱 //string mima = ConfigurationManager.AppSettings["mailPassWord"].ToString();//发送者邮箱密码 //string mailShowName = ConfigurationManager.AppSettings["mailShowName"].ToString();//邮件主题 //string body = "欢迎注册月月兴个人会员!请点击<div><a href='http://" + url + "?username="******"&usertype=0'>月月兴验证</a>链接完成注册!</div>"; //if (MailMessageExtensions.SendMail(mailShowName, body, mailAccount, mb.m_Email, mima)) //{ Session["newpmid"]=new BLL.MemberBase().Add(mb); if (int.Parse(Session["newpmid"].ToString())> 0) { Session["registerusername"] = username; Session["registeremail"] = email; return View("successRegiser"); } else { return Content("<script>alert('注册失败,系统信息异常!');location.href='singleRegister'</script>"); } //} //else //{ // return Content("<script>alert('注册失败,您输入邮箱的不存在!');location.href='singleRegister'</script>"); //} } catch (Exception) { return Content("<script>alert('注册失败,系统信息异常!');location.href='singleRegister'</script>"); } }
/// <summary> /// 得到一个对象实体 /// </summary> public Model.MemberBase GetModel(int m_ID) { StringBuilder strSql = new StringBuilder(); strSql.Append("select top 1 * from MemberBase "); strSql.Append(" where m_ID=@m_ID"); SqlParameter[] parameters = { new SqlParameter("@m_ID", SqlDbType.Int,4) }; parameters[0].Value = m_ID; Model.MemberBase model = new Model.MemberBase(); DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { return DataRowToModel(ds.Tables[0].Rows[0]); } else { return null; } }
/// <summary> /// 得到一个对象实体 /// </summary> public Model.MemberBase DataRowToModel(DataRow row) { Model.MemberBase model = new Model.MemberBase(); if (row != null) { if (row["m_ID"] != null && row["m_ID"].ToString() != "") { model.m_ID = int.Parse(row["m_ID"].ToString()); } if (row["m_UserName"] != null) { model.m_UserName = row["m_UserName"].ToString(); } if (row["m_Password"] != null) { model.m_Password = row["m_Password"].ToString(); } if (row["m_UserType"] != null && row["m_UserType"].ToString() != "") { model.m_UserType = int.Parse(row["m_UserType"].ToString()); } if (row["m_YingYZZ"] != null) { model.m_YingYZZ = row["m_YingYZZ"].ToString(); } if (row["m_Score"] != null && row["m_Score"].ToString() != "") { model.m_Score = int.Parse(row["m_Score"].ToString()); } if (row["m_Rank"] != null && row["m_Rank"].ToString() != "") { model.m_Rank = int.Parse(row["m_Rank"].ToString()); } if (row["m_NickName"] != null) { model.m_NickName = row["m_NickName"].ToString(); } if (row["m_RealName"] != null) { model.m_RealName = row["m_RealName"].ToString(); } if (row["m_Sex"] != null && row["m_Sex"].ToString() != "") { model.m_Sex = int.Parse(row["m_Sex"].ToString()); } if (row["m_Birthday"] != null && row["m_Birthday"].ToString() != "") { model.m_Birthday = DateTime.Parse(row["m_Birthday"].ToString()); } if (row["m_Phone"] != null) { model.m_Phone = row["m_Phone"].ToString(); } if (row["m_Email"] != null) { model.m_Email = row["m_Email"].ToString(); } if (row["m_QQ"] != null) { model.m_QQ = row["m_QQ"].ToString(); } if (row["m_CreatedOn"] != null && row["m_CreatedOn"].ToString() != "") { model.m_CreatedOn = DateTime.Parse(row["m_CreatedOn"].ToString()); } if (row["m_ZheK"] != null && row["m_ZheK"].ToString() != "") { model.m_ZheK = decimal.Parse(row["m_ZheK"].ToString()); } if (row["m_StatusCode"] != null && row["m_StatusCode"].ToString() != "") { model.m_StatusCode = int.Parse(row["m_StatusCode"].ToString()); } if (row["m_ShenPstatus"] != null && row["m_ShenPstatus"].ToString() != "") { model.m_ShenPstatus = int.Parse(row["m_ShenPstatus"].ToString()); } if (row["m_GDPhone"] != null && row["m_GDPhone"].ToString() != "") { model.m_GDPhone = row["m_GDPhone"].ToString(); } if (row["m_GongSiName"] != null && row["m_GongSiName"].ToString() != "") { model.m_GongSiName =row["m_GongSiName"].ToString(); } if (row["m_GongSiDiQu"] != null && row["m_GongSiDiQu"].ToString() != "") { model.m_GongSiDiQu =row["m_GongSiDiQu"].ToString(); } if (row["m_Introduction"] != null && row["m_Introduction"].ToString() != "") { model.m_Introduction = row["m_Introduction"].ToString(); } if (row["m_GongSiAddress"] != null && row["m_GongSiAddress"].ToString() != "") { model.m_GongSiAddress = row["m_GongSiAddress"].ToString(); } if (row["m_CloseDate"] != null && row["m_CloseDate"].ToString() != "") { model.m_CloseDate = DateTime.Parse(row["m_CloseDate"].ToString()); } if (row["m_HeadImg"] != null && row["m_HeadImg"].ToString() != "") { model.m_HeadImg = row["m_HeadImg"].ToString(); } if (row["m_Provice"] != null && row["m_Provice"].ToString() != "") { model.m_Provice = int.Parse(row["m_Provice"].ToString()); } if (row["m_City"] != null && row["m_City"].ToString() != "") { model.m_City = int.Parse(row["m_City"].ToString()); } if (row["m_Count"] != null && row["m_Count"].ToString() != "") { model.m_Count = int.Parse(row["m_Count"].ToString()); } if (row["m_mailyanzheng"] != null) { model.m_mailyanzheng = bool.Parse(row["m_mailyanzheng"].ToString()); } if (row["m_ZhiYe"] != null) { model.m_ZhiYe = row["m_ZhiYe"].ToString(); } } return model; }
/// <summary> /// 获得数据列表 /// </summary> public List<Model.MemberBase> DataTableToList(DataTable dt) { List<Model.MemberBase> modelList = new List<Model.MemberBase>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Model.MemberBase model; for (int n = 0; n < rowsCount; n++) { model = new Model.MemberBase(); if (dt.Rows[n]["m_ID"] != null && dt.Rows[n]["m_ID"].ToString() != "") { model.m_ID = int.Parse(dt.Rows[n]["m_ID"].ToString()); } if (dt.Rows[n]["m_UserName"] != null && dt.Rows[n]["m_UserName"].ToString() != "") { model.m_UserName = dt.Rows[n]["m_UserName"].ToString(); } if (dt.Rows[n]["m_Password"] != null && dt.Rows[n]["m_Password"].ToString() != "") { model.m_Password = dt.Rows[n]["m_Password"].ToString(); } if (dt.Rows[n]["m_UserType"] != null && dt.Rows[n]["m_UserType"].ToString() != "") { model.m_UserType = int.Parse(dt.Rows[n]["m_UserType"].ToString()); } if (dt.Rows[n]["m_YingYZZ"] != null && dt.Rows[n]["m_YingYZZ"].ToString() != "") { model.m_YingYZZ =dt.Rows[n]["m_YingYZZ"].ToString(); } if (dt.Rows[n]["m_Score"] != null && dt.Rows[n]["m_Score"].ToString() != "") { model.m_Score = int.Parse(dt.Rows[n]["m_Score"].ToString()); } if (dt.Rows[n]["m_Rank"] != null && dt.Rows[n]["m_Rank"].ToString() != "") { model.m_Rank = int.Parse(dt.Rows[n]["m_Rank"].ToString()); } if (dt.Rows[n]["m_NickName"] != null && dt.Rows[n]["m_NickName"].ToString() != "") { model.m_NickName = dt.Rows[n]["m_NickName"].ToString(); } if (dt.Rows[n]["m_RealName"] != null && dt.Rows[n]["m_RealName"].ToString() != "") { model.m_RealName = dt.Rows[n]["m_RealName"].ToString(); } if (dt.Rows[n]["m_Sex"] != null && dt.Rows[n]["m_Sex"].ToString() != "") { model.m_Sex = int.Parse(dt.Rows[n]["m_Sex"].ToString()); } if (dt.Rows[n]["m_Birthday"] != null && dt.Rows[n]["m_Birthday"].ToString() != "") { model.m_Birthday = DateTime.Parse( dt.Rows[n]["m_Birthday"].ToString()); } if (dt.Rows[n]["m_Phone"] != null && dt.Rows[n]["m_Phone"].ToString() != "") { model.m_Phone = dt.Rows[n]["m_Phone"].ToString(); } if (dt.Rows[n]["m_Email"] != null && dt.Rows[n]["m_Email"].ToString() != "") { model.m_Email = dt.Rows[n]["m_Email"].ToString(); } if (dt.Rows[n]["m_QQ"] != null && dt.Rows[n]["m_QQ"].ToString() != "") { model.m_QQ = dt.Rows[n]["m_QQ"].ToString(); } if (dt.Rows[n]["m_CreatedOn"] != null && dt.Rows[n]["m_CreatedOn"].ToString() != "") { model.m_CreatedOn = DateTime.Parse( dt.Rows[n]["m_CreatedOn"].ToString()); } if (dt.Rows[n]["m_ZheK"] != null && dt.Rows[n]["m_ZheK"].ToString() != "") { model.m_ZheK = decimal.Parse( dt.Rows[n]["m_ZheK"].ToString()); } if (dt.Rows[n]["m_StatusCode"] != null && dt.Rows[n]["m_StatusCode"].ToString() != "") { model.m_StatusCode =int.Parse( dt.Rows[n]["m_StatusCode"].ToString()); } if (dt.Rows[n]["m_ShenPstatus"] != null && dt.Rows[n]["m_ShenPstatus"].ToString() != "") { model.m_ShenPstatus = int.Parse(dt.Rows[n]["m_ShenPstatus"].ToString()); } if (dt.Rows[n]["m_GDPhone"] != null && dt.Rows[n]["m_GDPhone"].ToString() != "") { model.m_GDPhone = dt.Rows[n]["m_GDPhone"].ToString(); } if (dt.Rows[n]["m_GongSiName"] != null && dt.Rows[n]["m_GongSiName"].ToString() != "") { model.m_GongSiName = dt.Rows[n]["m_GongSiName"].ToString(); } if (dt.Rows[n]["m_GongSiDiQu"] != null && dt.Rows[n]["m_GongSiDiQu"].ToString() != "") { model.m_GongSiDiQu = dt.Rows[n]["m_GongSiDiQu"].ToString(); } if (dt.Rows[n]["m_GongSiAddress"] != null && dt.Rows[n]["m_GongSiAddress"].ToString() != "") { model.m_GongSiAddress = dt.Rows[n]["m_GongSiAddress"].ToString(); } if (dt.Rows[n]["m_CloseDate"] != null && dt.Rows[n]["m_CloseDate"].ToString() != "") { model.m_CloseDate = DateTime.Parse(dt.Rows[n]["m_CloseDate"].ToString()); } if (dt.Rows[n]["m_Introduction"] != null && dt.Rows[n]["m_Introduction"].ToString() != "") { model.m_Introduction = dt.Rows[n]["m_Introduction"].ToString(); } if (dt.Rows[n]["m_HeadImg"] != null && dt.Rows[n]["m_HeadImg"].ToString() != "") { model.m_HeadImg = dt.Rows[n]["m_HeadImg"].ToString(); } if (dt.Rows[n]["m_Provice"] != null && dt.Rows[n]["m_Provice"].ToString() != "") { model.m_Provice = int.Parse(dt.Rows[n]["m_Provice"].ToString()); } if (dt.Rows[n]["m_City"] != null && dt.Rows[n]["m_City"].ToString() != "") { model.m_City = int.Parse(dt.Rows[n]["m_City"].ToString()); } if (dt.Rows[n]["m_Count"] != null && dt.Rows[n]["m_Count"].ToString() != "") { model.m_Count = int.Parse(dt.Rows[n]["m_Count"].ToString()); } if (dt.Rows[n]["m_mailyanzheng"] != null && dt.Rows[n]["m_mailyanzheng"].ToString() != "") { model.m_mailyanzheng = bool.Parse(dt.Rows[n]["m_mailyanzheng"].ToString()); } if (dt.Rows[n]["m_ZhiYe"] != null && dt.Rows[n]["m_ZhiYe"].ToString() != "") { model.m_ZhiYe = dt.Rows[n]["m_ZhiYe"].ToString(); } if (model != null) { modelList.Add(model); } } } return modelList; }
private string SavePCRegister() { string nickname = Form["nickname"]; string phone = Form["phone"]; string address = Form["address"]; string email = Form["email"]; string password = Form["password"]; string result = ""; try { DataSet ds = new BLL.MemberBase().GetList(" m_StatusCode!=2 and m_UserName='******'"); if (ds.Tables[0].Rows.Count > 0) { result = "{'result':'被注册!'}"; } else { Model.MemberBase mb = new Model.MemberBase(); mb.m_NickName = nickname; mb.m_Phone = phone; mb.m_GongSiAddress = address; mb.m_UserName = email; string pwd = FormsAuthentication.HashPasswordForStoringInConfigFile(password, "MD5"); mb.m_Password = pwd; mb.m_Email = email; mb.m_UserType = 0; mb.m_ZheK = 1; mb.m_ShenPstatus = 1; mb.m_Rank = 1; mb.m_Score = 0; int flog = new BLL.MemberBase().Add(mb); if (flog > 0) { result = "{'result':'保存成功!'}"; } else { result = "{'result':'保存失败!'}"; } } return result; } catch (Exception) { result = "{'result':'保存失败!'}"; throw; } }
public ActionResult vipscore() { int pageSize = 6;//每一页的行数 int pageNumber = 1;//当前页数 DateTime from, to; string where = ""; int mid = 0; if (LoginMember != null) { mid = (CookieEncrypt.DeserializeObject(System.Web.HttpContext.Current.Request.Cookies["UserInfo"].Value) as Model.MemberBase).m_ID; Model.MemberBase mmodel = new Model.MemberBase(); Model.OrderBase omodel = new Model.OrderBase(); int fen = 0; decimal fenj = 0; var list = new BLL.OrderBase().GetModelListbypric(" m_ID=" + mid + " and o_StatusCode=4 and o_IsDel=0 order by o_CreateOn desc"); foreach (var i in list) { fen += int.Parse(i.o_Score.ToString()); } var pagelist = list.ToPagedList(pageNumber, pageSize); var mlist = new BLL.MemberBase().GetModel(mid); ViewData["mScore"] = mlist.m_Score; ViewData["mid"] = mid; ViewData["count"] = list.Count; ViewData["pagerows"] = pageSize; ViewData["page"] = pageNumber; var jifen = new BLL.NewsBase().GetModelList(" n_Title='积分规则' and n_StatusCode=0 and n_IsDel=0"); ViewBag.jifen = jifen[0].n_Content; ViewBag.orderinfo = pagelist.ToList(); List<Model.RejectionBase> lvlist = new BLL.RejectionBase().GetModelList(" m_ID=" + mid + " and r_Status=2 and r_Isdelete=0"); foreach (var i in lvlist) { if ((i.r_Price.ToString()).IndexOf('.') > 0) { fenj += int.Parse((i.r_Price.ToString()).Substring(0, (i.r_Price.ToString()).IndexOf('.'))); } } if (fen - int.Parse(fenj.ToString()) > 0) { ViewData["jifenshu"] = fen - int.Parse(fenj.ToString()); } else { ViewData["jifenshu"] = 0; } return View(lvlist.ToList()); } else { Response.Redirect("/Index/Index"); return View(); } }
public ActionResult LeftMenu() { int mid = 0; if (LoginMember != null) { mid = (CookieEncrypt.DeserializeObject(System.Web.HttpContext.Current.Request.Cookies["UserInfo"].Value) as Model.MemberBase).m_ID; Model.MemberBase mbmodel = new Model.MemberBase(); mbmodel = new BLL.MemberBase().GetModel(mid); if (mbmodel.m_UserType == 0) { ViewData["Iscompany"] = false; } else { ViewData["Iscompany"] = true; } } return View(); }