public ActionResult Index(RePassword password) { var operator1 = (User)HttpContext.Session[Common.Constants.USER_KEY]; var model = operatorBll.GetOperatorbyId(operator1.SysOperator.ID); if (model.Password != Util.GetPassword(model.LoginName, password.OldPassword.Trim())) { TempData["resultMsgType"] = "error"; TempData["resultMsg"] = "旧密码不正确"; return(View()); } else { var result = operatorBll.AlterPassword(operator1.SysOperator.ID, Util.GetPassword(model.LoginName, password.NewPassword.Trim())); if (result > 0) { TempData["resultMsgType"] = "success"; TempData["resultMsg"] = "修改成功"; return(RedirectToAction("Index")); } else { TempData["resultMsgType"] = "error"; TempData["resultMsg"] = "修改失败"; return(View()); } } }
public ActionResult RelationSupplier() { var opid = Convert.ToInt64(Request["id"]); var operators = operatorBll.GetOperatorbyId(opid); if (operators != null) { var model = new OperatorSupplier(); model.ID = operators.ID; model.LoginName = operators.LoginName; model.RealName = operators.RealName; var relation = sysoperatersupplier.GetSupplierByOperator(operators.ID); if (relation != null) { model.Supplier = relation.Supplier; long organization; if (long.TryParse(relation.Reserve, out organization)) { model.Orgnization = organization; } } return(View(model)); } else { return(RedirectToAction("Index")); } }
public ActionResult Edit() { var opid = Convert.ToInt64(Request["id"]); var operators = operatorBll.GetOperatorbyId(opid); if (operators != null) { var model = new OperaterAddEdit(); model.ID = operators.ID; model.LoginName = operators.LoginName; model.RealName = operators.RealName; model.Email = operators.Email; model.Mobile = operators.Mobile; model.IdCard = operators.IdCard; return(View(model)); } else { return(RedirectToAction("Index")); } }