Beispiel #1
0
        /// <summary>
        /// 联系方式
        /// </summary>
        /// <param name="id"></param>
        /// <param name="UserPhone"></param>
        /// <param name="SalesmanEmail"></param>
        /// <param name="SalesmanVX"></param>
        /// <returns></returns>
        public int EditContact(int id, string UserPhone, string SalesmanEmail, string SalesmanVX)
        {
            Userd userd = db.Userd.Find(id);

            userd.UserPhone  = UserPhone;
            userd.UserdEmail = SalesmanEmail;
            userd.UserdVX    = SalesmanVX;
            return(db.SaveChanges());
        }
        // GET: Lease
        public ActionResult Index(int LeaseID)
        {
            Userd userd = Session["Userds"] as Userd;

            if (userd != null)
            {
                ViewBag.a = LeaseHousesBLL.SFollow(LeaseID, userd.UserID).Count;
            }
            ViewBag.Facilities = LeaseHousesBLL.OnlyFacilities(LeaseID);
            ViewBag.Only       = LeaseHousesBLL.Only(LeaseID);
            ViewBag.LImg       = LeaseHousesBLL.OnlyLImg(LeaseID);
            return(View());
        }
 /// <summary>
 /// 个人信息
 /// </summary>
 /// <returns></returns>
 public ActionResult Information(Userd userd)
 {
     userd = Session["Userds"] as Userd;
     if (userd == null)
     {
         return(RedirectToAction("Index", "Login"));
     }
     else
     {
         ViewBag.MyInformation = bLL.MyInformation(userd.UserID);
         return(View());
     }
 }
Beispiel #4
0
        /// <summary>
        /// 修改联系方式
        /// </summary>
        /// <param name="userd"></param>
        /// <param name="UserPhone"></param>
        /// <param name="SalesmanEmail"></param>
        /// <param name="SalesmanVX"></param>
        /// <returns></returns>
        public ActionResult EditContact(Salesman salesman, string SalesmanPhone, string SalesmanEmail, string SalesmanVX)
        {
            Userd u  = Session["Userds"] as Userd;
            int   id = u.UserID;

            if (bLL.EditContact(id, SalesmanPhone, SalesmanEmail, SalesmanVX) > 0)
            {
                return(Content("<script>alert('修改成功');history.go(-1)</script>"));
            }
            else
            {
                return(Content("<script>alert('修改失败');history.go(-1)</script>"));
            }
        }
        /// <summary>
        /// 修改联系方式
        /// </summary>
        /// <param name="userd"></param>
        /// <param name="UserPhone"></param>
        /// <param name="SalesmanEmail"></param>
        /// <param name="SalesmanVX"></param>
        /// <returns></returns>
        public ActionResult EditContact(Userd userd, string UserPhone, string SalesmanEmail, string SalesmanVX)
        {
            Userd u  = Session["Userds"] as Userd;
            int   id = u.UserID;

            if (bLL.EditContact(id, UserPhone, SalesmanEmail, SalesmanVX) > 0)
            {
                return(RedirectToAction("Information", "Business"));
            }
            else
            {
                return(Content("<script>alert('无数据更新,修改失败');history.go(-1)</script>"));
            }
        }
        /// <summary>
        /// 添加订单(出租)
        /// </summary>
        /// <returns></returns>
        public ActionResult LIndex()
        {
            Userd userds = Session["Userds"] as Userd;

            if (userds == null)
            {
                return(RedirectToAction("Index", "Login"));
            }
            else
            {
                ViewBag.saman = bLL.SelectMan();
                return(View());
            }
        }
        /// <summary>
        /// 我的关注
        /// </summary>
        /// <returns></returns>
        public ActionResult Follow(int?id)
        {
            Userd userd = Session["Userds"] as Userd;

            if (userd == null)
            {
                return(RedirectToAction("Index", "Login"));
            }
            else
            {
                ViewBag.Follow = bLL.Follow(userd.UserID);
                return(View());
            }
        }
 public ActionResult Add(Userd userd)
 {
     if (bll.AddUserd(userd) == 1)
     {
         return(RedirectToAction("Index", "HomePage"));
     }
     else if (bll.AddUserd(userd) == 2)
     {
         return(Content("<script>alert('注册失败');history.go(-1);</script>"));
     }
     else
     {
         return(Content("<script>alert('账号已存在');history.go(-1);</script>"));
     }
 }
        public ActionResult RFollow(int?id)
        {
            Userd userd = Session["Userds"] as Userd;

            if (userd != null)
            {
                LeaseHousesBLL.DeleSFollow(id ?? 0, userd.UserID);
                int sid = id ?? 0;
                return(RedirectToAction("Index", new { LeaseID = sid }));
            }
            else
            {
                return(RedirectToAction("Index", "Login"));
            }
        }
        /// <summary>
        /// 修改密码
        /// </summary>
        /// <param name="newpassword1"></param>
        /// <param name="UserPassword"></param>
        /// <returns></returns>
        public ActionResult EditPassword(string newpassword1, string UserPassword)
        {
            Userd userd = Session["Userds"] as Userd;
            int   id    = userd.UserID;
            int   a     = bLL.EditPassword(newpassword1, id, UserPassword);

            if (a == 1)
            {
                return(RedirectToAction("Information", "Business"));
            }
            else
            {
                return(Content("<script>alert('修改失败');history.go(-1)</script>"));
            }
        }
Beispiel #11
0
        //SellingHousesBLL bll = new SellingHousesBLL();

        //出售界面
        // GET: Selling
        public ActionResult Index(int SellID)
        {
            //var SellID = 1;
            Userd userd = Session["Userds"] as Userd;

            if (userd != null)
            {
                ViewBag.a = SellingHousesBLL.SFollow(SellID, userd.UserID).Count;
            }
            ViewBag.Selling = SellingHousesBLL.OnlySelling(SellID);
            ViewBag.Only    = SellingHousesBLL.Only(SellID);
            ViewBag.Tran    = SellingHousesBLL.OnlyTransactions(SellID);
            ViewBag.SImg    = SellingHousesBLL.OnlySImg(SellID);
            return(View());
        }
 /// <summary>
 /// 我的财产
 /// </summary>
 /// <returns></returns>
 public ActionResult Property(Userd userd, int?page)
 {
     userd = Session["Userds"] as Userd;
     if (userd == null)
     {
         return(RedirectToAction("Index", "Login"));
     }
     else
     {
         var a          = bLL.MySell(userd.UserID);
         int pageNumber = page ?? 1;
         //每页显示多少条
         int pageSize = 2;
         ///通过ToPagedList扩展方法进行分页
         var usePageList = a.ToPagedList(pageNumber, pageSize);
         return(View(usePageList));
     }
 }
        /// <summary>
        /// 修改图片
        /// </summary>
        /// <param name="userd"></param>
        /// <returns></returns>
        public ActionResult EditUserd(Userd userd)
        {
            int   a      = 0;
            Userd userds = db.Userd.Find(userd.UserID);

            //添加商品图片
            if (Request.Files.Count > 0)
            {
                string[]      fileTypeStr = { "image/gif", "image/png", "image/jpeg", "image/jpg", "image/bmp" };
                List <string> strlist     = new List <string>();
                for (int i = 0; i < Request.Files.Count; i++)
                {
                    if (fileTypeStr.Contains(Request.Files[i].ContentType))
                    {
                        string fileName = Path.GetFileName(Request.Files[i].FileName);
                        userds.Photo           = fileName;
                        db.Entry(userds).State = System.Data.Entity.EntityState.Modified;//修改
                        a = db.SaveChanges();
                    }
                }
                if (a > 0)
                {
                    //保存文件
                    //应用程序需要有服务器UploadFile文件夹的读写权限
                    for (int i = 0; i < Request.Files.Count; i++)
                    {
                        Request.Files[i].SaveAs(Server.MapPath("~/Content/Photo/" + Request.Files[i].FileName));
                    }
                    Session["Userd"] = db.Userd.Find(userd.UserID);

                    return(RedirectToAction("Information", "Business"));
                }
                else
                {
                    return(Content("<script>alert('上传失败');history.go(-1)</script>"));
                }
            }
            else
            {
                return(Content("<script>alert('修改失败');history.go(-1)</script>"));
            }
        }
Beispiel #14
0
        /// <summary>
        /// 新增用户
        /// </summary>
        /// <param name="Role"></param>
        /// <param name="Name"></param>
        /// <param name="Email"></param>
        /// <param name="Password"></param>
        /// <returns></returns>
        public int AddUserd(Userd userd)
        {
            int a = 0;

            //if (db.Userd.Where(p => p.UserdEmail == userd.UserdEmail).ToList() == null)
            //{
            db.Userd.Add(userd);
            a = db.SaveChanges();
            if (a == 1)
            {
                return(a);
            }
            else
            {
                a = 2;
                return(a);
            }
            //}
            //else
            //{
            //    return a;
            //}
        }
 /// <summary>
 /// 新增用户
 /// </summary>
 /// <param name="Role"></param>
 /// <param name="Name"></param>
 /// <param name="Email"></param>
 /// <param name="Password"></param>
 /// <returns></returns>
 public int AddUserd(Userd userd)
 {
     return(dal.AddUserd(userd));
 }