Example #1
0
        /// <summary>
        /// 发送手机验证码(重置密码)
        /// </summary>
        /// <returns></returns>
        public ActionResult ResetPhoneCode()
        {
            string phone = Request["phone"].ToString();//取现接受验证码手机号码
            //验证注册的手机号码唯一性
            var Vphone = HomeBLL.GetUserInfoByPhone(phone);

            if (Vphone == null)
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "当前手机号不存在,请确认"));
            }
            DateTime Vdate;
            //Session["RegCode"] = "123456";//验证码
            //Session["Vdate"] = DateTime.Now;//验证码发送时间
            //return OperContext.PackagingAjaxMsg(AjaxStatu.ok, "验证码已发送您的手机,请获取");

            string count = SendPhoneCode.SendVerifyCode(phone, out Vdate);//发送验证码

            if (count != "")
            {
                Session["RegCode"] = count; //验证码
                Session["Vdate"]   = Vdate; //验证码发送时间
                return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "验证码已发送您的手机,请获取"));
            }
            else
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "验证码发送失败"));
            }
        }
Example #2
0
        /// <summary>
        /// 派发需求给服务方数据交互
        /// </summary>
        /// <returns></returns>
        public ActionResult NeedToCareParsonData()
        {
            //验证登录
            if (!User.Identity.IsAuthenticated)
            {
                return(RedirectToAction("SignIn", "Home"));
            }
            var OrderID     = Request["OrderID"];
            var AdminUserID = Request["AdminUserID"];

            int count = AdminsBLL.UpdOrderAdminUserID(OrderID, AdminUserID);

            if (count > 0)
            {
                int cnt = AdminsBLL.UpdOrderStatus(OrderID, 2);
                if (cnt > 0)
                {
                    return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "服务人员派发成功", null, "/MemberM/CheckedCare/"));
                }
                else
                {
                    return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "需求状态更新失败", null, "/MemberM/CheckedCare/"));
                }
            }
            else
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "服务人员派发失败"));
            }
        }
Example #3
0
        /// <summary>
        /// 密码重置
        /// </summary>
        /// <returns></returns>
        public ActionResult ResetPwd()
        {
            var LoginPwd  = Request["txtUserPwd"].ToString();
            var UserPhone = Request["txtPhone"].ToString();

            LoginPwd = Utility.DesEncrypt(LoginPwd);            //加密
            var ValidCode = Request["txtValidCode"].ToString(); //短信验证码

            if (System.Web.HttpContext.Current.Session["RegCode"] == null)
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "验证码过期,请重新发送!"));
            }
            if (System.Web.HttpContext.Current.Session["RegCode"].ToString() != ValidCode)
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "验证码错误"));
            }
            if (Convert.ToDateTime(Session["Vdate"]) < DateTime.Now.AddMinutes(-2))
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "验证码过期,请重新发送"));
            }

            int count = HomeBLL.UpdUserPwd(UserPhone, LoginPwd);

            if (count > 0)
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "密码重置成功", null, "/Home/Login/"));
            }
            else
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "密码重置失败"));
            }
        }
Example #4
0
        /// <summary>
        /// 订单列表数据
        /// </summary>
        /// <returns></returns>
        public ActionResult NeedOrderListData()
        {
            //验证登录
            if (!User.Identity.IsAuthenticated)
            {
                return(RedirectToAction("SignIn", "Home"));
            }
            var userid = Request["userid"];
            List <OrderModel> MoneyList = AdminsBLL.GetOrderList();

            if (!string.IsNullOrEmpty(userid))
            {
                MoneyList = MoneyList.Where(item => item.AdminUserID == userid).ToList();
            }
            MoneyList = MoneyList.OrderByDescending(item => item.CreateDate).ToList();
            if (MoneyList != null && MoneyList.Count > 0)
            {
                DataTable NewDT      = JsonHelper.ListToDataTable(MoneyList);
                var       jsonString = JsonHelper.DataTableToJsonString(NewDT);
                return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "", jsonString));
            }
            else
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.none, ""));
            }
        }
Example #5
0
        /// <summary>
        /// 获取管理员信息数据
        /// </summary>
        /// <returns></returns>
        public ActionResult AdminListData()
        {
            //验证登录
            if (!User.Identity.IsAuthenticated)
            {
                return(RedirectToAction("SignIn", "Home"));
            }
            var search             = Request["search"] == null ? "" : Request["search"].ToString();//搜索条件
            List <tb_Admins> RList = AdminsBLL.GetAlladminInfo();

            if (search != "")
            {
                //RList = RList.Where(item => item.HouseName.Contains(search)).ToList();
                RList = RList.Where(item => item.NickName.Contains(search) ||
                                    item.Mobile.Contains(search) ||
                                    item.AdminID.Contains(search) ||
                                    item.RealName.Contains(search)).ToList();
            }
            RList = RList.OrderByDescending(item => item.CreateDate).ToList();
            DataTable newOrder = Utility.ListToDataTable(RList);

            if (newOrder != null && newOrder.Rows.Count > 0)
            {
                var jsonString = Utility.DataTableToJsonString(newOrder);
                return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "", jsonString));
            }
            else
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.none, ""));
            }
        }
Example #6
0
        /// <summary>
        /// 修改密码数据交互
        /// </summary>
        /// <returns></returns>
        public ActionResult UpdUserWpdData()
        {
            var phone       = User.Identity.Name;
            var UserPhone   = Request["UserPhone"];
            var LoginPwd    = Request["LoginPwd"];
            var newLoginPwd = Request["newLoginPwd"];

            LoginPwd    = Utility.DesEncrypt(LoginPwd);
            newLoginPwd = Utility.DesEncrypt(newLoginPwd);
            if (UserPhone != phone)
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "您要修改的账号与手机号码不匹配"));
            }
            var user = HomeBLL.GetLoginInfo(UserPhone, LoginPwd);

            if (user != null)
            {
                int count = HomeBLL.UpdUserPwd(UserPhone, newLoginPwd);
                if (count > 0)
                {
                    return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "密码修改成功", null, "/User/Index/"));
                }
                else
                {
                    return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "密码修改失败"));
                }
            }
            else
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "原始密码不正确"));
            }
        }
Example #7
0
        /// <summary>
        /// 获取看护方审批数据
        /// </summary>
        /// <returns></returns>
        public ActionResult CheckedCareData()
        {
            var search = Request["search"] == null ? "" : Request["search"].ToString(); //搜索条件
            var type   = Request["type"] == null ? "" : Request["type"].ToString();     //类型
            List <OrderModel> RList = AdminsBLL.GetOrderList();

            if (search != "")
            {
                RList = RList.Where(item => item.NickName.Contains(search) ||
                                    item.UserPhone.Contains(search)).ToList();
            }
            if (type != "")
            {
                RList = RList.Where(item => item.OrderType == type).ToList();
            }
            RList = RList.OrderByDescending(item => item.CreateDate).ToList();
            RList = RList.Distinct(new ListComparer <OrderModel>((p1, p2) => (p1.OrderID == p2.OrderID))).ToList();//去除重复数据
            DataTable newOrder = Utility.ListToDataTable(RList);

            if (newOrder != null && newOrder.Rows.Count > 0)
            {
                var jsonString = Utility.DataTableToJsonString(newOrder);
                return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "", jsonString));
            }
            else
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.none, ""));
            }
        }
Example #8
0
        /// <summary>
        /// 启用/禁用管理员
        /// </summary>
        /// <returns></returns>
        public ActionResult UpdateMemberStatus()
        {
            //验证登录
            if (!User.Identity.IsAuthenticated)
            {
                return(RedirectToAction("SignIn", "Home"));
            }
            var MemberID = Request["ID"];
            var flag     = Request["Status"];

            if (flag == "1")
            {
                int count = AdminsBLL.UpdAdminStatus(MemberID, Convert.ToInt32(flag));
                if (count > 0)
                {
                    return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "启用成功"));
                }
                else
                {
                    return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "启用失败"));
                }
            }
            else
            {
                int count = AdminsBLL.UpdAdminStatus(MemberID, Convert.ToInt32(flag));
                if (count > 0)
                {
                    return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "禁用成功"));
                }
                else
                {
                    return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "禁用失败"));
                }
            }
        }
Example #9
0
        /// <summary>
        /// 修改密码数据交互
        /// </summary>
        /// <returns></returns>
        public ActionResult UpdAdminWpdData()
        {
            //验证登录
            if (!User.Identity.IsAuthenticated)
            {
                return(RedirectToAction("SignIn", "Home"));
            }
            var phone       = User.Identity.Name;
            var UserPhone   = Request["UserPhone"];
            var LoginPwd    = Request["LoginPwd"];
            var newLoginPwd = Request["newLoginPwd"];

            LoginPwd    = Utility.DesEncrypt(LoginPwd);
            newLoginPwd = Utility.DesEncrypt(newLoginPwd);
            if (UserPhone != phone)
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "您要修改的账号与手机号码不匹配"));
            }

            int count = AdminsBLL.UpdAdminPwd(UserPhone, LoginPwd, newLoginPwd);

            if (count > 0)
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "密码修改成功", null, "/Home/Index/"));
            }
            else
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "密码修改失败"));
            }
        }
Example #10
0
        /// <summary>
        /// 修改后台用户信息
        /// </summary>
        /// <returns></returns>
        public ActionResult UpdRegisterData()
        {
            //验证登录
            if (!User.Identity.IsAuthenticated)
            {
                return(RedirectToAction("Login", "Home"));
            }
            var       ID       = Request["ID"];
            var       AdminID  = Request["AdminID"];
            var       RealName = Request["RealName"];
            var       Mobile   = Request["Mobile"];
            var       NickName = Request["NickName"];
            tb_Admins am       = new tb_Admins();

            am.ID       = ID;
            am.AdminID  = AdminID;
            am.RealName = RealName;
            am.Mobile   = Mobile;
            am.NickName = NickName;
            int count = AdminsBLL.UpdRegister(am);

            if (count > 0)
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "信息修改成功", null, "/Home/AdminList/"));
            }
            else
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "修改失败"));
            }
        }
Example #11
0
        public ActionResult AddXuQiuPicData()
        {
            var Title  = Request["Title"];
            var Memo   = Request["Memo"];
            var ImgUrl = Request["ImgUrl"];
            int picCnt = 0;//图片



            //图片
            if (!string.IsNullOrEmpty(ImgUrl))
            {
                tb_Pictuer pic = new tb_Pictuer();
                pic.PicTitle = Title;
                pic.OrderID  = "需求主图";
                pic.PicUrl   = ImgUrl;
                pic.Memo     = Memo;
                picCnt       = DemandBLL.PictureIns(pic);
            }


            if (!string.IsNullOrEmpty(ImgUrl) && picCnt <= 0)
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "需求图片提交失败,请联系管理员!"));
            }

            return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "需求图片提交成功!", null, "/UploadFile/UploadPicture/"));
        }
Example #12
0
        /// <summary>
        /// 获取数据
        /// </summary>
        /// <returns></returns>
        public ActionResult AboutUsData()
        {
            //验证登录
            if (!User.Identity.IsAuthenticated)
            {
                return(RedirectToAction("SignIn", "Home"));
            }
            var search = Request["search"] == null ? "" : Request["search"].ToString(); //搜索条件
            var type   = Request["type"] == null ? "" : Request["type"].ToString();     //类型
            List <tb_Context> RList = AdminsBLL.GetContextList();

            if (search != "")
            {
                RList = RList.Where(item => item.Title.Contains(search) ||
                                    item.Explain.Contains(search)).ToList();
            }
            if (type != "")
            {
                RList = RList.Where(item => item.Type == type).ToList();
            }
            RList = RList.OrderByDescending(item => item.CreateDate).ToList();
            //RList = RList.Distinct(new ListComparer<tb_Context>((p1, p2) => (p1.OrderID == p2.OrderID))).ToList();//去除重复数据
            DataTable newOrder = Utility.ListToDataTable(RList);

            if (newOrder != null && newOrder.Rows.Count > 0)
            {
                var jsonString = Utility.DataTableToJsonString(newOrder);
                return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "", jsonString));
            }
            else
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.none, ""));
            }
        }
Example #13
0
        public ActionResult EidtContextData()
        {
            //验证登录
            if (!User.Identity.IsAuthenticated)
            {
                return(RedirectToAction("SignIn", "Home"));
            }
            var        Title     = Request["Title"];
            var        Explain   = Request["Explain"];
            var        ContextID = Request["ContextID"];
            var        Type      = Request["Type"];
            var        Intro     = Request["Intro"];
            tb_Context con       = new tb_Context();

            con.Title     = Title;
            con.Explain   = Explain;
            con.Type      = Type;
            con.Intro     = Intro;
            con.ContextID = ContextID;
            int count = AdminsBLL.UpdContextData(con);

            if (count > 0)
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "图文信息修改成功!", null, "/UploadFile/AboutUs/"));
            }
            else
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "图文信息修改失败"));
            }
        }
Example #14
0
        /// <summary>
        /// 课后照护数据
        /// </summary>
        /// <returns></returns>
        public ActionResult AdminClassCareData()
        {
            //验证登录
            if (!User.Identity.IsAuthenticated)
            {
                return(RedirectToAction("SignIn", "Home"));
            }
            var phone  = User.Identity.Name;                                            //手机号码
            var search = Request["search"] == null ? "" : Request["search"].ToString(); //搜索条件
            var type   = Request["type"] == null ? "" : Request["type"].ToString();     //类型
            List <OrderModel> RList = AdminsBLL.GetOrderList();

            RList = RList.Where(item => !string.IsNullOrEmpty(item.AdminUserID) && item.Status >= 1).ToList();
            //获取后台管理员权限
            var admin = AdminsBLL.GetAdminInfoByAdmin(phone);
            //获取前台用户编号
            var adminUser = HomeBLL.GetUserInfoByPhone(phone);

            if (admin != null)
            {
                if (admin.Memo != "超级管理员")
                {
                    if (adminUser != null)
                    {
                        RList = RList.Where(item => item.AdminUserID == adminUser.ID).ToList();
                    }
                    else
                    {
                        return(OperContext.PackagingAjaxMsg(AjaxStatu.none, ""));
                    }
                }
            }

            if (search != "")
            {
                RList = RList.Where(item => item.NickName.Contains(search) ||
                                    item.UserPhone.Contains(search)).ToList();
            }
            if (type != "")
            {
                RList = RList.Where(item => item.OrderType == type).ToList();
            }
            RList = RList.OrderByDescending(item => item.CreateDate).ToList();
            RList = RList.Distinct(new ListComparer <OrderModel>((p1, p2) => (p1.OrderID == p2.OrderID))).ToList();//去除重复数据
            DataTable newOrder = Utility.ListToDataTable(RList);

            if (newOrder != null && newOrder.Rows.Count > 0)
            {
                var jsonString = Utility.DataTableToJsonString(newOrder);
                return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "", jsonString));
            }
            else
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.none, ""));
            }
        }
Example #15
0
        /// <summary>
        /// 兼职保姆数据交互
        /// </summary>
        /// <returns></returns>
        public ActionResult NancyData()
        {
            var userPhone = User.Identity.Name;
            //获取用户ID
            var userID   = HomeBLL.GetUserInfoByPhone(userPhone).ID.ToString();
            var listdata = PartTimeBLL.GetPartTimeData(userID);

            if (listdata.Count > 0)
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.none, "您已申请了" + listdata[0].Post + "职位,请注意接收来电!"));
            }
            var username   = Request["username"];
            var sex        = Request["sex"];
            var work       = Request["work"];
            var date_range = Request["date_range"];
            var serve1     = Request["serve1"];
            var serve2     = Request["serve2"];
            var salary     = Request["salary"];
            var memo       = Request["memo"];//职位性质
            //var tel = Request["tel"];
            tb_PartTime pt = new tb_PartTime();

            pt.UserID         = userID;
            pt.UserName       = username;
            pt.Education      = null;
            pt.YearWork       = work;
            pt.DateRange      = date_range;
            pt.RoomService    = serve1;
            pt.AgencyService  = serve2;
            pt.Salary         = Convert.ToDecimal(salary);
            pt.Phone          = userPhone;
            pt.Post           = "保姆";
            pt.SchoolName     = null;
            pt.GraduationYear = null;
            pt.Sex            = sex;
            pt.Memo           = memo;
            //获取用户ID
            int count = PartTimeBLL.SetPartTimeTeacher(pt);

            if (count > 0)
            {
                int cnt = PartTimeBLL.UpdUserRole(userID, 1);//0:普通会员;1:保姆;2:教师;3:陪护/看护
                if (cnt > 0)
                {
                    return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "保姆申请成功,请注意接收来电", null, "/User/Index/"));
                }
                else
                {
                    return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "保姆申请失败"));
                }
            }
            else
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.none, "保姆申请失败"));
            }
        }
Example #16
0
        /// <summary>
        /// 注册数据交互
        /// </summary>
        /// <returns></returns>
        public ActionResult RegisterIn()
        {
            tb_User UserInfo = new tb_User();

            UserInfo.LoginPwd  = Request["txtUserPwd"].ToString();
            UserInfo.UserPhone = Request["txtPhone"].ToString();
            UserInfo.NickName  = Request["txtNick"].ToString();
            UserInfo.LoginPwd  = Utility.DesEncrypt(UserInfo.LoginPwd); //加密
            var ValidCode = Request["txtValidCode"].ToString();         //短信验证码

            if (System.Web.HttpContext.Current.Session["RegCode"] == null)
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "验证码过期,请重新发送!"));
            }
            if (System.Web.HttpContext.Current.Session["RegCode"].ToString() != ValidCode)
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "验证码错误"));
            }
            if (Convert.ToDateTime(Session["Vdate"]) < DateTime.Now.AddMinutes(-2))
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "验证码过期,请重新发送"));
            }
            //验证注册的手机号码唯一性
            var Vphone = HomeBLL.GetUserInfoByPhone(UserInfo.UserPhone);

            if (Vphone != null)
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "当前手机号已存在,请换更换"));
            }

            int count = HomeBLL.SetUserInfo(UserInfo);//主表

            if (count > 0)
            {
                //登录信息写入cookie
                //FormsAuthentication.SetAuthCookie(userphone, false);
                FormsAuthenticationTicket ticket   = new FormsAuthenticationTicket(1, UserInfo.UserPhone, DateTime.Now, DateTime.Now.AddDays(7), true, UserInfo.ImgUrl);
                FormsIdentity             identity = new FormsIdentity(ticket);
                HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName, FormsAuthentication.Encrypt(ticket));
                if (ticket.IsPersistent)
                {
                    cookie.Expires = ticket.Expiration;
                }
                Response.Cookies.Add(cookie);
                return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "注册成功", null, "/User/Index/"));
            }
            else
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "注册失败"));
            }
        }
Example #17
0
        /// <summary>
        /// 验证当前等会账号是否存在
        /// </summary>
        /// <returns></returns>
        public ActionResult ChkAccountExist()
        {
            string usernmae = Request["usernmae"].ToString();//接受验证码手机号码
            var    aa       = "";

            if (aa != null)
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "当前登录账号已存在,请换更换"));
            }
            else
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "当前登录账号不存在,可以注册"));
            }
        }
Example #18
0
        /// <summary>
        /// 删除图片
        /// </summary>
        /// <returns></returns>
        public ActionResult DelPic()
        {
            var picid = Request["PicID"];
            int count = AdminsBLL.DelPicData(picid);

            if (count > 0)
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "删除成功"));
            }
            else
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "删除失败"));
            }
        }
Example #19
0
        /// <summary>
        /// 验证当前手机号码是否存在
        /// </summary>
        /// <returns></returns>
        public ActionResult ChkPhoneExist()
        {
            string phone = Request["phone"].ToString();//取现接受验证码手机号码
            var    aa    = "";

            if (aa != null)
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "当前手机号已存在,请换更换"));
            }
            else
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "当前手机号不存在,可以注册"));
            }
        }
Example #20
0
        /// <summary>
        /// 删除视频
        /// </summary>
        /// <returns></returns>
        public ActionResult DelVideo()
        {
            var videoid = Request["VideoID"];
            int count   = AdminsBLL.DelVideoData(videoid);

            if (count > 0)
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "删除成功"));
            }
            else
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "删除失败"));
            }
        }
Example #21
0
        public ActionResult AddClassCareData()
        {
            var OrderID  = Request["OrderID"];
            var Title    = Request["Title"];
            var Memo     = Request["Memo"];
            var VideoUrl = Request["VideoUrl"];
            var ImgUrl   = Request["ImgUrl"];
            //var OrderClassify = Request["OrderClassify"];
            //var OrderType = Request["OrderType"];
            //var OrderIntro = Request["OrderIntro"];
            //var OrderID = Utility.GetNewGUID();
            int picCnt   = 0; //图片
            int videoCnt = 0; //视频


            //图片
            if (!string.IsNullOrEmpty(ImgUrl))
            {
                tb_Pictuer pic = new tb_Pictuer();
                pic.PicTitle = Title;
                pic.OrderID  = OrderID;
                pic.PicUrl   = ImgUrl;
                pic.Memo     = Memo;
                picCnt       = DemandBLL.PictureIns(pic);
            }

            //视频
            if (!string.IsNullOrEmpty(VideoUrl))
            {
                tb_Video video = new tb_Video();
                video.VideoTitle = Title;
                video.OrderID    = OrderID;
                video.VideoUrl   = VideoUrl;
                video.Memo       = Memo;
                videoCnt         = DemandBLL.VideoIns(video);
            }
            if (!string.IsNullOrEmpty(ImgUrl) && picCnt <= 0)
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "图片提交失败,请联系管理员!"));
            }
            if (!string.IsNullOrEmpty(VideoUrl) && videoCnt <= 0)
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "视频提交失败,请联系管理员!"));
            }

            return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "信息提交成功请查看详情!", null, "/MemberM/AdminClassCare/"));
        }
Example #22
0
        /// <summary>
        /// 通过/驳回需求
        /// </summary>
        /// <returns></returns>
        public ActionResult UpdateStatus()
        {
            //验证登录
            if (!User.Identity.IsAuthenticated)
            {
                return(RedirectToAction("SignIn", "Home"));
            }
            var orderid = Request["ID"];
            var flag    = Request["Status"];

            if (flag == "1")
            {
                int count = AdminsBLL.UpdOrderStatus(orderid, Convert.ToInt32(flag));
                if (count > 0)
                {
                    return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "审核成功"));
                }
                else
                {
                    return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "审核失败"));
                }
            }
            else if (flag == "-1")
            {
                int count = AdminsBLL.UpdOrderStatus(orderid, Convert.ToInt32(flag));
                if (count > 0)
                {
                    return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "驳回成功"));
                }
                else
                {
                    return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "驳回失败"));
                }
            }
            else
            {
                int count = AdminsBLL.UpdOrderStatus(orderid, Convert.ToInt32(flag));
                if (count > 0)
                {
                    return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "回访成功"));
                }
                else
                {
                    return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "回访失败"));
                }
            }
        }
Example #23
0
        /// <summary>
        /// 获取删除数据
        /// </summary>
        /// <returns></returns>
        public ActionResult DelClassCareData()
        {
            //验证登录
            if (!User.Identity.IsAuthenticated)
            {
                return(RedirectToAction("SignIn", "Home"));
            }
            var OrderID = Request["orderid"];
            //var search = Request["search"] == null ? "" : Request["search"].ToString();//搜索条件
            //图片
            List <tb_Pictuer> picList = AdminsBLL.GetPicList();

            picList = picList.Where(item => item.OrderID == OrderID && item.Status == 1).ToList();
            //视频
            List <tb_Video> videoList = AdminsBLL.GetVideoList();

            videoList = videoList.Where(item => item.OrderID == OrderID && item.Status == 1).ToList();


            //if (search != "")
            //{
            //    picList = picList.Where(item => item.PicTitle.Contains(search) ||
            //                               item.Memo.Contains(search)).ToList();
            //    videoList = videoList.Where(item => item.VideoTitle.Contains(search) ||
            //                              item.Memo.Contains(search)).ToList();
            //}
            picList   = picList.OrderByDescending(item => item.CreateDate).ToList();
            videoList = videoList.OrderByDescending(item => item.CreateDate).ToList();
            DataTable newOrder1 = Utility.ListToDataTable(picList);
            DataTable newOrder2 = Utility.ListToDataTable(videoList);

            if (newOrder1 != null || newOrder2 != null)
            {
                var jsonString1 = Utility.DataTableToJsonString(newOrder1);
                var jsonString2 = Utility.DataTableToJsonString(newOrder2);

                jsonlist jsonString = new jsonlist();
                jsonString.pic   = jsonString1;
                jsonString.video = jsonString2;
                return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "", jsonString));
            }
            else
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.none, ""));
            }
        }
        /// <summary>
        /// 幼儿看护数据查询
        /// </summary>
        /// <returns></returns>
        public ActionResult InfantCare_hourData()
        {
            List <OrderModel> DataList = UserBLL.GetOrderRecordList();

            DataList = DataList.Where(item => item.OrderType == "幼儿看护").OrderByDescending(item => item.CreateDate).ToList();
            DataList = DataList.Distinct(new ListComparer <OrderModel>((p1, p2) => (p1.OrderID == p2.OrderID))).ToList();
            if (DataList != null && DataList.Count > 0)
            {
                DataTable NewDT      = JsonHelper.ListToDataTable(DataList);
                var       jsonString = JsonHelper.DataTableToJsonString(NewDT);
                return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "", jsonString));
            }
            else
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.none, ""));
            }
        }
Example #25
0
        /// <summary>
        /// 发布需求数据交互
        /// </summary>
        /// <returns></returns>
        public ActionResult OwnNeedData()
        {
            var OrderType = Request["OrderType"];//需求分类
            var userPhone = User.Identity.Name;
            //获取用户ID
            var userID = HomeBLL.GetUserInfoByPhone(userPhone).ID.ToString();

            List <OrderModel> MoneyList = UserBLL.GetOrderRecordList();

            MoneyList = MoneyList.Where(item => item.Status >= 0).ToList();
            if (!string.IsNullOrEmpty(userID))
            {
                MoneyList = MoneyList.Where(item => item.UserID == userID).ToList();
            }
            if (!string.IsNullOrEmpty(OrderType))
            {
                if (OrderType == "ClassCare")
                {
                    MoneyList = MoneyList.Where(item => item.OrderType == "共享保姆/课后托管照护").ToList();
                }
                else if (OrderType == "GravidaCare")
                {
                    MoneyList = MoneyList.Where(item => item.OrderType == "孕检照护").ToList();
                }
                else if (OrderType == "InfantCare")
                {
                    MoneyList = MoneyList.Where(item => item.OrderType == "婴幼照护").ToList();
                }
                else if (OrderType == "OldAgeCare")
                {
                    MoneyList = MoneyList.Where(item => item.OrderType == "养老照护").ToList();
                }
            }
            MoneyList = MoneyList.Distinct(new ListComparer <OrderModel>((p1, p2) => (p1.OrderID == p2.OrderID))).ToList();
            MoneyList = MoneyList.OrderByDescending(item => item.CreateDate).ToList();
            if (MoneyList != null && MoneyList.Count > 0)
            {
                DataTable NewDT      = JsonHelper.ListToDataTable(MoneyList);
                var       jsonString = JsonHelper.DataTableToJsonString(NewDT);
                return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "", jsonString));
            }
            else
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.none, ""));
            }
        }
Example #26
0
        /// <summary>
        /// 修改订单状态
        /// </summary>
        /// <returns></returns>
        public ActionResult UpdOrderStatus()
        {
            var orderid   = Request["orderid"];
            var status    = Request["status"];
            var userphone = User.Identity.Name;
            var userInfo  = HomeBLL.GetUserInfoByPhone(userphone);;//获取用户信息

            int count = UserBLL.UpdOrderStatus(orderid, Convert.ToInt32(status));

            if (count > 0)
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "更新状态成功", null, "/User/UserDetails/?OrderID=" + orderid + ""));
            }
            else
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "更新状态失败,请联系管理员"));
            }
        }
Example #27
0
        /// <summary>
        /// 删除图片
        /// </summary>
        /// <returns></returns>
        public ActionResult DelPicTure()
        {
            //验证登录
            if (!User.Identity.IsAuthenticated)
            {
                return(RedirectToAction("SignIn", "Home"));
            }
            var PicID = Request["PicID"];
            int count = AdminsBLL.DelPicData(PicID);

            if (count > 0)
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "删除成功!"));
            }
            else
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "删除失败"));
            }
        }
Example #28
0
        /// <summary>
        /// 通过/驳回申请职位
        /// </summary>
        /// <returns></returns>
        public ActionResult UpdateCareRole()
        {
            //验证登录
            if (!User.Identity.IsAuthenticated)
            {
                return(RedirectToAction("SignIn", "Home"));
            }
            var userid = Request["ID"];
            var flag   = Request["flag"];

            if (flag == "1")
            {
                int count = AdminsBLL.UpdRoleStatus(userid, Convert.ToInt32(flag));
                if (count > 0)
                {
                    return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "申请成功"));
                }
                else
                {
                    return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "申请失败"));
                }
            }
            else
            {
                int count = AdminsBLL.DelPart(userid);
                if (count > 0)
                {
                    int cnt = AdminsBLL.UpdOldRoleStatus(userid);
                    if (cnt > 0)
                    {
                        return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "职位驳回请重新申请"));
                    }
                    else
                    {
                        return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "驳回失败"));
                    }
                }
                else
                {
                    return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "驳回失败"));
                }
            }
        }
Example #29
0
        /// <summary>
        /// 登录数据验证
        /// </summary>
        /// <returns></returns>
        public ActionResult SignInData()
        {
            var AdminID  = Request["AdminID"].ToString();
            var AdminPwd = Request["AdminPwd"].ToString();

            AdminPwd = Utility.DesEncrypt(AdminPwd);//加密

            bool adminCHK = AdminsBLL.ChkAdminInfo(AdminID, AdminPwd);

            if (adminCHK)
            {//登录成功
                int count = AdminsBLL.UpdateLastDateTime(AdminID);
                if (count < 0)
                {
                    return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "登录时间更新失败"));
                }
                //获取管理员菜单
                //Session["AdminsMenu"] = AdminsBLL.GetAdminMenu(AdminID);
                //获取信息
                var adminData = AdminsBLL.GetAdminInfoByAdmin(AdminID);
                //管理员ID、
                Session["NickName"] = adminData.NickName;
                Session["Mobile"]   = adminData.Mobile;
                Session.Timeout     = 1000;
                //登录信息写入cookie
                //FormsAuthentication.SetAuthCookie(Phone, false);
                FormsAuthenticationTicket ticket   = new FormsAuthenticationTicket(1, adminData.Mobile, DateTime.Now, DateTime.Now.AddDays(2), true, adminData.NickName);
                FormsIdentity             identity = new FormsIdentity(ticket);
                HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName, FormsAuthentication.Encrypt(ticket));
                if (ticket.IsPersistent)
                {
                    cookie.Expires = ticket.Expiration;
                }
                Response.Cookies.Add(cookie);
                return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "登录成功", null, "/Home/Index/"));
            }
            else//登录失败
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "用户名或密码错误!"));
            }
        }
Example #30
0
        public ActionResult DesDecodeData()
        {
            //验证登录
            //if (!User.Identity.IsAuthenticated)
            //{
            //    return RedirectToAction("SignIn", "Home");
            //}
            string Pwd      = string.Empty;
            var    LoginPwd = Request["LoginPwd"];//密码

            Pwd = Utility.DesDecrypt(LoginPwd);

            if (Pwd == null || Pwd == "")
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "解密失败"));
            }
            else
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "解密完成", Pwd));
            }
        }