/// <summary> /// 个人信息 /// </summary> /// <returns></returns> public ActionResult Information() { var user = wbll.GetUserInfo(Request); List<DbParameter> parameter = new List<DbParameter>(); parameter.Add(DbFactory.CreateDbParameter("@Number", user.Number)); var account = database.FindEntityByWhere<Ho_PartnerUser>(" and Number=@Number", parameter.ToArray()); if (account != null && account.Number != null) { return View(account); } return View(); }
public ActionResult SubmitHeadImg(string HeadImg) { if (StringHelper.IsNullOrEmpty(HeadImg)) { return(Content(new JsonMessage { Success = false, Code = "0", Message = "请先上传头像" }.ToString())); } WebData wbll = new WebData(); var model = wbll.GetUserInfo(Request); model.HeadImg = HeadImg; model.Modify(model.Number); IDatabase database = DataFactory.Database(); int result = database.Update(model); if (result > 0) { return(Content(new JsonMessage { Success = true, Code = "1", Message = "修改成功" }.ToString())); } else { return(Content(new JsonMessage { Success = false, Code = "0", Message = "修改失败" }.ToString())); } }
/// <summary> /// 提交预约 /// </summary> /// <param name="model"></param> /// <param name="Code"></param> /// <returns></returns> public ActionResult SubmitOrders(Ho_MySubscribe model, string Code) { string realCode = DESEncrypt.Decrypt(CookieHelper.GetCookie("WebCode")); if (StringHelper.IsNullOrEmpty(Code) || Code != realCode) { return(Content(new JsonMessage { Success = false, Code = "0", Message = "验证码不正确" }.ToString())); } //获取用户 WebData wbll = new WebData(); var umodel = wbll.GetUserInfo(Request); IDatabase database = DataFactory.Database(); DbTransaction isOpenTrans = database.BeginTrans(); try { var myhmodel = database.FindEntity <Ho_MyHouseInfo>(model.MHNumber); if (myhmodel == null) { return(Content(new JsonMessage { Success = false, Code = "-1", Message = "数据异常" }.ToString())); } model.HImg = myhmodel.Himg; model.HName = myhmodel.HName; model.HNumber = myhmodel.HNumber; model.OverTime = DateTime.Now.AddDays(int.Parse(model.MYTime)); model.Status = 0; model.StatusStr = "已提交"; model.UCardCode = umodel.CardCode; model.UCode = umodel.InnerCode; model.UMobile = umodel.Mobile; model.UName = umodel.Name; model.UNumber = umodel.Number; model.Create(); //预约信息提交 database.Insert(model, isOpenTrans); //更新我的业务状态 myhmodel.Status = 1; myhmodel.StatusStr = "已预约"; database.Update(myhmodel, isOpenTrans); //事务提交 database.Commit(); return(Content(new JsonMessage { Success = true, Code = "1", Message = "预约成功" }.ToString())); } catch (Exception) { database.Rollback(); return(Content(new JsonMessage { Success = false, Code = "-1", Message = "数据异常" }.ToString())); } }
public ActionResult WeChat(long orderId) { if (orderId == 0) { return(Redirect("~/404Page.html")); } var user = wbll.GetUserInfo(Request); var account = database.FindEntityByWhere <Ho_PartnerUser>(" and Number=" + user.Number); if (account != null && account.Number != null) { List <DbParameter> parameter = new List <DbParameter>(); parameter.Add(DbFactory.CreateDbParameter("@U_Number", account.Number)); parameter.Add(DbFactory.CreateDbParameter("@OrderNumber", orderId)); var payOrder = database.FindEntityByWhere <Am_Charge>(" and U_Number=@U_Number and @OrderNumber=OrderNumber", parameter.ToArray()); if (payOrder == null) { return(Redirect("~/404Page.html")); } else if (payOrder.STATUS > 0) { ///已经支付 return(RedirectToAction("AlreadyPayed", "Payment")); } else { WePay _wePay = new WePay(); AlipayAndWepaySDK.Model.TransmiParameterModel model = new AlipayAndWepaySDK.Model.TransmiParameterModel(); model.orderNo = payOrder.OrderNumber; model.productName = "充值"; model.totalFee = 10; model.customerIP = "180.136.144.49"; model.openId = account.OpenId; var payUrl = _wePay.BuildWePay(model, AlipayAndWepaySDK.Enum.EnumWePayTradeType.JSAPI); // return Newtonsoft.Json.JsonConvert.SerializeObject(payUrl); } } return(View()); }
/// <summary> /// 获取业务列表-废 /// </summary> /// <returns></returns> public ActionResult GetHo_MyHouse() { IDatabase database = DataFactory.Database(); WebData wbll = new WebData(); var omodel = wbll.GetUserInfo(Request); string sql = "select * from Ho_MyHouseInfo where UNumber = '" + omodel.Number + "'"; var list = database.FindListBySql <Ho_MyHouseInfo>(sql); return(Content(list.ToJson())); }
//预约信息 public ActionResult GetSubscribe(string Number) { WebData wbll = new WebData(); var umodel = wbll.GetUserInfo(Request); IDatabase database = DataFactory.Database(); string sql = "select top 1 * from Ho_MySubscribe where UNumber = '" + umodel.Number + "' and MHNumber = '" + Number + "' order by CreateTime desc"; //获取用户最后一条预约信息 var omodel = database.FindListBySql <Ho_MySubscribe>(sql).FirstOrDefault(); return(Content(omodel.ToJson())); }
public ActionResult Edit() { WebData wbll = new WebData(); var model = wbll.GetUserInfo(Request); model.HeadImg = StringHelper.IsNullOrEmpty(model.HeadImg) ? "/Content/UiImages/nane-top.png" : model.HeadImg; model.Mobile = model.Mobile.Substring(0, 2) + "*****" + model.Mobile.Substring(7); ViewBag.User = model; return(View()); }
/// <summary> /// 合伙人 /// </summary> /// <returns></returns> public ActionResult MyPartner() { //获取用户 WebData wbll = new WebData(); var umodel = wbll.GetUserInfo(Request); string tempstr = "NO"; if (umodel == null || umodel.Status == 0) { tempstr = "YES"; } ViewBag.IsSign = tempstr; return(View()); }
/// <summary> /// 首页 /// </summary> /// <returns></returns> //[WeixinOAuthAuthorize] public ActionResult Index(string opendID, string nickname, string headimgurl) { //本地测试用 //opendID = "o504Tt2emU6hYPUGW9LpOa5aPlV4"; //正式使用 WebData wbll = new WebData(); var model = wbll.GetUserInfo(Request); if ((model == null || StringHelper.IsNullOrEmpty(model.OpenId)) && StringHelper.IsNullOrEmpty(opendID)) { return(Redirect("http://www.pthl600.com/Wap/OtherGetOpenId")); } IDatabase database = DataFactory.Database(); var userModel = database.FindEntityByWhere <Ho_PartnerUser>(" and OpenId = '" + (StringHelper.IsNullOrEmpty(opendID) ? model.OpenId : opendID) + "'"); if (userModel == null || StringHelper.IsNullOrEmpty(userModel.Number)) { var amodel = database.FindListBySql <Ho_Assistant>("select top 1 * from Ho_Assistant").FirstOrDefault(); userModel = new Ho_PartnerUser() { Name = nickname, OpenId = opendID, Birthday = DateTime.Now, HeadImg = headimgurl, ParentName = "0", ParentNumber = "0", InnerCode = "0", WeiXin = opendID, As_Number = amodel == null ? "0" : amodel.Number, As_Name = amodel == null ? "无" : amodel.Name, Sex = "" }; userModel.Create(); database.Insert(userModel); } // 抽取用户信息 string Md5 = Md5Helper.MD5(userModel.Number + opendID + Request.UserHostAddress + Request.Browser.Type + Request.Browser.ClrVersion.ToString() + "2017", 16); string str = userModel.Number + "&" + opendID + "&" + Request.UserHostAddress + "&" + Request.Browser.Type + "&" + Request.Browser.ClrVersion.ToString() + "&" + Md5; str = DESEncrypt.Encrypt(str); CookieHelper.WriteCookie("WebUserInfo", str); return(View()); }
//合同查看 public ActionResult ht(string name, string code) { if (!string.IsNullOrEmpty(name) && !string.IsNullOrEmpty(code)) { ViewBag.Name = name; ViewBag.Code = code; ViewBag.CreateTime = DateTime.Now.ToString("yyyy-MM-dd"); } else { WebData wbll = new WebData(); var model = wbll.GetUserInfo(Request); ViewBag.Name = model.Name; ViewBag.Code = model.CardCode; ViewBag.CreateTime = model.CreatTime.Value.ToString("yyyy-MM-dd"); } return(View()); }
public ActionResult Industry(string Number) { WebData wbll = new WebData(); var umodel = wbll.GetUserInfo(Request); IDatabase database = DataFactory.Database(); var model = database.FindEntity <Ho_MyHouseInfo>(Number); //var list = new List<Ho_SetSubscribe>(); ViewBag.Ho_MyHouseInfo = model; ViewBag.Mobile = umodel.Mobile.Substring(0, 3) + "****" + umodel.Mobile.Substring(8); if (umodel.CardCode.Length == 15) { umodel.CardCode = umodel.CardCode.Substring(0, 4) + "******" + umodel.CardCode.Substring(11); } else { umodel.CardCode = umodel.CardCode.Substring(0, 4) + "**********" + umodel.CardCode.Substring(14); } ViewBag.User = umodel; return(View()); }
public ActionResult Center() { WebData wbll = new WebData(); var model = wbll.GetUserInfo(Request); if (model == null) { return(Content("<script type='text/javascript'>alert('用户信息不存在');location.href='/Ui/Index';</script>")); } if (model.Status < 1) { return(Content("<script type='text/javascript'>alert('请先成为合伙人');location.href='/Ui/Information';</script>")); } IDatabase database = DataFactory.Database(); model.HeadImg = StringHelper.IsNullOrEmpty(model.HeadImg) ? "/Content/UiImages/nane-top.png" : model.HeadImg; model.CardCode = StringHelper.IsNullOrEmpty(model.CardCode) ? "" : model.CardCode.Substring(0, 4) + "*******" + model.CardCode.Substring(model.CardCode.Length - 4); //如果已经设置了助理则显示,没设置则返回默认的 var amodel = database.FindListBySql <Ho_Assistant>("select * from Ho_Assistant where Number = '" + model.As_Number + "'").FirstOrDefault(); if (amodel == null) { amodel = new Ho_Assistant() { Name = "未分配", Weixin = "xxxx", Mobile = "18888888888", HeadImg = "/Content/Images/noimg.gif" }; //新建一个空白的先 } string sql = "select * from Ho_MyHouseInfo where UNumber = '" + model.Number + "' and HNumber in (select Number from Ho_HouseInfo where IsDel = 0 and Status = 1)"; var list = database.FindListBySql <Ho_MyHouseInfo>(sql); ViewBag.Ho_PartnerUser = model; ViewBag.Ho_Assistant = amodel; ViewBag.List = (model.Status != 9) ? list : new List <Ho_MyHouseInfo>(); return(View()); }
/// <summary> /// 修改手机号码 /// </summary> /// <param name="Phone"></param> /// <param name="Code"></param> /// <returns></returns> public ActionResult ModifyPhone(string Phone, string Code) { if (StringHelper.IsNullOrEmpty(Phone) || Phone.Length < 11) { return(Content(new JsonMessage { Success = false, Code = "0", Message = "手机号码错误" }.ToString())); } string realCode = DESEncrypt.Decrypt(CookieHelper.GetCookie("WebCode")); if (StringHelper.IsNullOrEmpty(Code) || Code != realCode) { return(Content(new JsonMessage { Success = false, Code = "0", Message = "验证码不正确" }.ToString())); } WebData wbll = new WebData(); var model = wbll.GetUserInfo(Request); model.Mobile = Phone; model.Modify(model.Number); IDatabase database = DataFactory.Database(); int result = database.Update(model); if (result > 0) { return(Content(new JsonMessage { Success = true, Code = "1", Message = "修改成功" }.ToString())); } else { return(Content(new JsonMessage { Success = false, Code = "0", Message = "修改失败" }.ToString())); } }
/// <summary> /// 合伙人信息完善 /// </summary> /// <param name="model"></param> /// <param name="Code"></param> /// <returns></returns> public ActionResult SubmitUser(Ho_PartnerUser nmodel, string Code) { string realCode = DESEncrypt.Decrypt(CookieHelper.GetCookie("WebCode")); if (StringHelper.IsNullOrEmpty(Code) || Code != realCode) { return(Content(new JsonMessage { Success = false, Code = "0", Message = "验证码不正确" }.ToString())); } if (StringHelper.IsNullOrEmpty(nmodel.CardCode) || !IdCardHelper.CheckIDCard(nmodel.CardCode)) { return(Content(new JsonMessage { Success = false, Code = "0", Message = "身份证号码不正确" }.ToString())); } //验证手机号码和身份证的唯一 IDatabase database = DataFactory.Database(); int codecount = database.FindCount <Ho_PartnerUser>(" and CardCode = '" + nmodel.CardCode + "'"); if (codecount > 0) { return(Content(new JsonMessage { Success = false, Code = "0", Message = "身份证号码已存在" }.ToString())); } int Mobile = database.FindCount <Ho_PartnerUser>(" and Mobile = '" + nmodel.Mobile + "'"); if (Mobile > 0) { return(Content(new JsonMessage { Success = false, Code = "0", Message = "手机号码已存在" }.ToString())); } WebData wbll = new WebData(); var model = wbll.GetUserInfo(Request); model.Birthday = Convert.ToDateTime(IdCardHelper.GetBrithdayFromIdCard(nmodel.CardCode)); model.Sex = IdCardHelper.GetSexFromIdCard(nmodel.CardCode); model.CardCode = nmodel.CardCode; model.CodeImg1 = nmodel.CodeImg1; model.CodeImg2 = nmodel.CodeImg2; model.Mobile = nmodel.Mobile; model.ModifyTime = DateTime.Now; model.Name = nmodel.Name; model.Status = 2; model.StatusStr = "未认证"; model.CreatTime = DateTime.Now; //正式申请成为合伙人 model.Modify(model.Number); int result = database.Update(model); if (result > 0) { return(Content(new JsonMessage { Success = true, Code = "1", Message = "提交成功" }.ToString())); } else { return(Content(new JsonMessage { Success = false, Code = "0", Message = "提交失败" }.ToString())); } }
public ActionResult SetMyHouseList(string KeyValue) { if (StringHelper.IsNullOrEmpty(KeyValue)) { return(Content(new JsonMessage { Success = false, Code = "-1", Message = "查找信息失败" }.ToString())); } IDatabase database = DataFactory.Database(); WebData wbll = new WebData(); var omodel = wbll.GetUserInfo(Request); //判断是否已成为合伙人-如果没有,则完善信息,成为合伙人 //以下两种情况不能代售 if (omodel.Status == 0) //0-游客 { return(Content(new JsonMessage { Success = false, Code = "9", Message = "请先成为合伙人" }.ToString())); } else if (omodel.Status == 1)// 1- 提交信息未审核 { return(Content(new JsonMessage { Success = false, Code = "8", Message = "信息审核中,请等待..." }.ToString())); } else if (omodel.Status == 9)// 9- 黑名单不允许操作 { return(Content(new JsonMessage { Success = false, Code = "7", Message = "用户已禁用" }.ToString())); } var hmodel = database.FindEntity <Ho_HouseInfo>(KeyValue); if (hmodel == null) { return(Content(new JsonMessage { Success = false, Code = "-1", Message = "查找信息失败" }.ToString())); } //判断是否已代售 string sql = "and UNumber = '" + omodel.Number + "' and HNumber = '" + KeyValue + "'"; var count = database.FindCount <Ho_MyHouseInfo>(sql); if (count > 0) { return(Content(new JsonMessage { Success = false, Code = "-1", Message = "您已经代售了此楼盘" }.ToString())); } var model = new Ho_MyHouseInfo() { Himg = hmodel.img, HMoney = hmodel.Money, HName = hmodel.Name, HNumber = hmodel.Number, UNumber = omodel.Number, UName = omodel.Name }; model.Create(); var result = database.Insert(model); if (result > 0) { return(Content(new JsonMessage { Success = true, Code = "1", Message = "操作成功" }.ToString())); } else { return(Content(new JsonMessage { Success = false, Code = "0", Message = "操作失败" }.ToString())); } }