Ejemplo n.º 1
0
        public ActionResult Login(string LogName, string Pwd)
        {
            var model = new 企业用户DTO();
            var isLog = _iRosSer.List(model);

            if (!string.IsNullOrEmpty(LogName) && !string.IsNullOrEmpty(Pwd))
            {
                var user = isLog.Where(r => r.LogName == LogName && r.Pwd == Pwd).ToList();
                if (user.Count() == 1)
                {
                    Session["user"] = user.FirstOrDefault();
                    var json = new
                    {
                        code  = 200,
                        msg   = "Sign",
                        count = 0,
                        data  = ""
                    };
                    return(Json(json));
                }
            }

            var result = new
            {
                code  = 0,
                msg   = "账号或密码错误",
                count = 0,
                data  = ""
            };

            return(Json(result));
        }
Ejemplo n.º 2
0
        public ActionResult UpReg(企业用户DTO dto)
        {
            if (Session["user"] != null || dto.Id > 0)
            {
                var info = _iRosSer.GetDTO(dto.Id);
                if (info == null)
                {
                    info = _iRosSer.GetDTO(((企业用户DTO)Session["user"]).Id);
                }
                info.CompanyName = dto.CompanyName;
                info.Address     = dto.Address;
                info.WebSite     = dto.WebSite;
                info.Service     = dto.Service;
                _iRosSer.Save(info);

                Session["user"] = info;
            }
            var json = new
            {
                code  = 0,
                msg   = "用户信息更新成功",
                count = 0,
                data  = ""
            };

            return(Json(json));
        }
Ejemplo n.º 3
0
        public ActionResult Save(企业用户DTO dto)
        {
            //if(dto.Id==0) dto.Addtime= (int)((DateTime.Now.Ticks - 621356256000000000) / 10000000);
            var result = _iNewsSer.Save(dto);

            return(Json(result));
        }
Ejemplo n.º 4
0
        public ActionResult Edit(企业用户DTO dto)
        {
            企业用户DTO model = new 企业用户DTO();

            ViewBag.Categories = _iNewsSer.List(model);
            if (dto.Id > 0)
            {
                model = _iNewsSer.GetDTO(dto.Id);
            }

            return(View(model));
        }
Ejemplo n.º 5
0
        public ActionResult List(企业用户DTO dTO)
        {
            var list = _iNewsSer.List(dTO);
            var json = new
            {
                code  = 0,
                msg   = "",
                count = 0,
                data  = list.ToArray()
            };

            return(Json(json));
        }
Ejemplo n.º 6
0
        public JsonResult Delete(企业用户DTO dto)
        {
            var json = new
            {
                code  = 0,
                msg   = "删除成功",
                count = 0,
                data  = ""
            };

            if (dto.Id > 0)
            {
                _iNewsSer.Del(dto);
            }
            return(Json(json));
        }
Ejemplo n.º 7
0
        public ActionResult DoReg(企业用户DTO dto)
        {
            var model = new 企业用户DTO();
            var isreg = _iRosSer.List(model);

            if (isreg.Where(r => r.LogName == dto.LogName).Count() < 1)
            {
                _iRosSer.Save(dto);
            }
            var result = new
            {
                code  = 0,
                msg   = "注册成功",
                count = 0,
                data  = ""
            };

            return(Json(result));
        }
Ejemplo n.º 8
0
        public ActionResult Register()
        {
            var model = new 企业用户DTO();

            return(View(model));
        }