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)); }
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)); }
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)); }
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)); }
public ActionResult List(企业用户DTO dTO) { var list = _iNewsSer.List(dTO); var json = new { code = 0, msg = "", count = 0, data = list.ToArray() }; return(Json(json)); }
public JsonResult Delete(企业用户DTO dto) { var json = new { code = 0, msg = "删除成功", count = 0, data = "" }; if (dto.Id > 0) { _iNewsSer.Del(dto); } return(Json(json)); }
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)); }
public ActionResult Register() { var model = new 企业用户DTO(); return(View(model)); }