public ActionResult LoginOper_EditData(DXInfo.Models.tbLogin tbLogin) { var gridModel = new LoginOperGridModel(); SetupLoginOperGridModel(gridModel.LoginOperGrid); return(ajaxCallBack <DXInfo.Models.tbLogin>(gridModel.LoginOperGrid, tbLogin, addLoginOper, editLoginOper, delLoginOper)); }
private void editLoginOper(DXInfo.Models.tbLogin tbLogin) { var oldtbLogin = Uow.tbLogin.GetById(g => g.vcLoginID == tbLogin.vcLoginID); oldtbLogin.vcOperName = tbLogin.vcOperName; oldtbLogin.vcDeptID = tbLogin.vcDeptID; oldtbLogin.vcLimit = tbLogin.vcLimit; Uow.tbLogin.Update(oldtbLogin); Uow.Commit(); centerCommon.UpdateOper(tbLogin.vcLoginID, tbLogin.vcOperName, tbLogin.vcDeptID); }
private void delLoginOper(DXInfo.Models.tbLogin tbLogin) { var oldtbLogin = Uow.tbLogin.GetById(g => g.vcLoginID == tbLogin.vcLoginID); if (oldtbLogin != null) { Uow.tbLogin.Delete(oldtbLogin); Uow.Commit(); centerCommon.DeleteOper(tbLogin.vcLoginID); } }
private void addLoginOper(DXInfo.Models.tbLogin tbLogin) { int count = Uow.tbLogin.GetAll().Where(w => w.vcLoginID == tbLogin.vcLoginID || w.vcOperName == tbLogin.vcOperName).Count(); if (count > 0) { throw new BusinessException("登录ID或者操作员名称重复"); } tbLogin.vcPwd = "123456"; Uow.tbLogin.Add(tbLogin); Uow.Commit(); centerCommon.SyncOper(); }