public ActionResult btnSave_Click(FormCollection values) { CFG_USERINFO info = new CFG_USERINFO(); info.ID = Convert.ToInt32(values["Id"]); info.NAME = values["Name"]; info.SEX = Convert.ToInt32(values["Sex"]); info.USERNAME = values["UserName"]; info.USERPWD = values["UserPwd"]; info.AGE = values["Age"]; info.TELEPHONE = values["Telephone"]; info.CERTIFICATETYPE = Convert.ToInt32(values["CertificateType"]); info.CERTIFICATENUM = values["CertificateNum"]; info.DIRECTION = values["Direction"]; info.ADDRESS = values["Address"]; info.BELONGDEPTID = Convert.ToInt32(values["BelongDeptId"]); info.BELONGNETID = string.IsNullOrWhiteSpace(values["BelongNetId"]) ? -1 : Convert.ToInt32(values["BelongNetId"]); info.USERTYPE = Convert.ToInt32(values["UserType"]); info.REMARK = values["Remark"]; info.LOGINTYPE = Convert.ToInt32(values["LoginType"]); info.VIRTUALTRUMPET = values["VirtualTrumpet"]; var isSuccess = UserBLL.Update(info); ActiveWindow.HidePostBack(); if (isSuccess) { ShowNotify("数据修改成功!"); } else { ShowNotify("数据修改失败!"); } return(UIHelper.Result()); }
public ActionResult btnSave_Click(FormCollection values) { CFG_CARINFO info = new CFG_CARINFO(); info.ID = Convert.ToInt32(values["Id"]); info.VEHICLENO = values["VehicleNo"]; info.VEHICLETYPE = Convert.ToInt32(values["VehicleType"]); info.VEHICLEBRAND = values["VehicleBrand"]; info.BELONGDEPTID = Convert.ToInt32(values["BelongDeptId"]); info.BELONGNETID = Convert.ToInt32(values["BelongNetId"]); info.OWNERTYPE = Convert.ToInt32(values["OwnerType"]); info.REMARK = values["Remark"]; info.OWNER = values["Owner"]; info.CLDWZDSBH = values["Cldwzdsbh"]; info.WLWKHM = values["Wlwkhm"]; var isSuccess = CarBLL.Update(info); ActiveWindow.HidePostBack(); if (isSuccess) { ShowNotify("数据修改成功!"); } else { ShowNotify("数据修改失败!"); } return(UIHelper.Result()); }
public ActionResult btnSave_Click(FormCollection values) { CFG_NETINFO info = new CFG_NETINFO(); info.ID = Convert.ToInt32(values["Id"]); info.NAME = values["Name"]; info.BELONGDEPTID = Convert.ToInt32(values["BelongDeptId"]); info.POPULATIONINFO = values["PopulationInfo"]; info.HOUSEINFO = values["HouseInfo"]; info.BELONGAREA = values["BelongArea"]; info.UNITSTOREINFO = values["UnitStoreInfo"]; info.NETCOLOR = values["NetColor"]; info.LONANDLAT = values["LonAndLat"]; info.REMARK = values["Remark"]; var isSuccess = NetManageBLL.Update(info); ActiveWindow.HidePostBack(); if (isSuccess) { ShowNotify("数据修改成功!"); } else { ShowNotify("数据修改失败!"); } return(UIHelper.Result()); }
public ActionResult btnAdd_Click(FormCollection values) { var msg = NotificationBLL.SendMessage(values["Phone"], values["Title"], values["Content"]); ActiveWindow.HidePostBack(); ShowNotify(msg); return(UIHelper.Result()); }
public async Task <IActionResult> OnPostRoleUserNew_btnSaveClose_ClickAsync(int roleID, int[] selectedRowIDs) { AddEntities2 <RoleUser>(roleID, selectedRowIDs); await DB.SaveChangesAsync(); // 关闭本窗体(触发窗体的关闭事件) ActiveWindow.HidePostBack(); return(UIHelper.Result()); }
public async Task <IActionResult> OnPostUserChangePassword_btnSaveClose_ClickAsync(int hfUserID, string tbxPassword) { var item = await DB.Users.FindAsync(hfUserID); item.Password = PasswordUtil.CreateDbPassword(tbxPassword.Trim()); await DB.SaveChangesAsync(); // 关闭本窗体(触发窗体的关闭事件) ActiveWindow.HidePostBack(); return(UIHelper.Result()); }
public async Task <IActionResult> OnPostTitleNew_btnSaveClose_ClickAsync() { if (ModelState.IsValid) { DB.Titles.Add(Title); await DB.SaveChangesAsync(); // 关闭本窗体(触发窗体的关闭事件) ActiveWindow.HidePostBack(); } return(UIHelper.Result()); }
public async Task <IActionResult> OnPostRoleEdit_btnSaveClose_ClickAsync() { if (ModelState.IsValid) { DB.Entry(Role).State = EntityState.Modified; await DB.SaveChangesAsync(); // 关闭本窗体(触发窗体的关闭事件) ActiveWindow.HidePostBack(); } return(UIHelper.Result()); }
public async Task <IActionResult> OnPostUserEdit_btnSaveClose_ClickAsync(string hfSelectedDept, string hfSelectedRole, string hfSelectedTitle) { // 不对 Name 和 Password 进行模型验证 ModelState.Remove("Name"); ModelState.Remove("Password"); if (ModelState.IsValid) { // 更新部分字段(先从数据库检索用户,再覆盖用户输入值,注意没有更新Name,Password,CreateTime等字段) var _user = await DB.Users .Include(u => u.Dept) .Include(u => u.RoleUsers) .Include(u => u.TitleUsers) .Where(m => m.ID == CurrentUser.ID).FirstOrDefaultAsync(); _user.ChineseName = CurrentUser.ChineseName; _user.Gender = CurrentUser.Gender; _user.Enabled = CurrentUser.Enabled; _user.Email = CurrentUser.Email; _user.CompanyEmail = CurrentUser.CompanyEmail; _user.OfficePhone = CurrentUser.OfficePhone; _user.OfficePhoneExt = CurrentUser.OfficePhoneExt; _user.HomePhone = CurrentUser.HomePhone; _user.CellPhone = CurrentUser.CellPhone; _user.Remark = CurrentUser.Remark; int[] roleIDs = StringUtil.GetIntArrayFromString(hfSelectedRole); ReplaceEntities2 <RoleUser>(_user.RoleUsers, roleIDs, _user.ID); int[] titleIDs = StringUtil.GetIntArrayFromString(hfSelectedTitle); ReplaceEntities2 <TitleUser>(_user.TitleUsers, titleIDs, _user.ID); if (String.IsNullOrEmpty(hfSelectedDept)) { _user.DeptID = null; } else { _user.DeptID = Convert.ToInt32(hfSelectedDept); } await DB.SaveChangesAsync(); // 关闭本窗体(触发窗体的关闭事件) ActiveWindow.HidePostBack(); } return(UIHelper.Result()); }
public async Task <IActionResult> OnPostDeptUserNew_btnSaveClose_ClickAsync(int deptID, int[] selectedRowIDs) { var users = await DB.Users .Where(u => selectedRowIDs.Contains(u.ID)) .ToListAsync(); users.ForEach(u => u.DeptID = deptID); await DB.SaveChangesAsync(); // 关闭本窗体(触发窗体的关闭事件) ActiveWindow.HidePostBack(); return(UIHelper.Result()); }
public async Task <IActionResult> OnPostImportAsync(string txt) { try { await ParkingSpaceService.ImportFromJsonAsync(ParkDB, txt); ShowNotify("导入成功"); } catch (Exception ex) { ShowNotify("导入失败:" + ex.Message); } ActiveWindow.HidePostBack(); return(UIHelper.Result()); }
public ActionResult btnPasswordUpdateSave_Click(FormCollection values) { var isSuccess = UserBLL.UpdateUserPwd(Convert.ToInt32(values["UserId"]), values["Password"]); ActiveWindow.HidePostBack(); if (isSuccess) { ShowNotify("密码修改成功!"); } else { ShowNotify("密码修改失败!"); } return(UIHelper.Result()); }
public async Task <IActionResult> OnPostUserNew_btnSaveClose_ClickAsync(string hfSelectedDept, string hfSelectedRole, string hfSelectedTitle) { if (ModelState.IsValid) { var _user = await DB.Users.Where(u => u.Name == CurrentUser.Name).FirstOrDefaultAsync(); if (_user != null) { Alert.Show("用户 " + CurrentUser.Name + " 已经存在!"); return(UIHelper.Result()); } // 创建保存到数据库的密码 CurrentUser.Password = PasswordUtil.CreateDbPassword(CurrentUser.Password.Trim()); CurrentUser.CreateTime = DateTime.Now; // 添加所有部门 if (!String.IsNullOrEmpty(hfSelectedDept)) { CurrentUser.DeptID = Convert.ToInt32(hfSelectedDept); } // 添加所有角色 if (!String.IsNullOrEmpty(hfSelectedRole)) { int[] roleIDs = StringUtil.GetIntArrayFromString(hfSelectedRole); AddEntities2 <RoleUser>(roleIDs, CurrentUser.ID); } // 添加所有职称 if (!String.IsNullOrEmpty(hfSelectedTitle)) { int[] titleIDs = StringUtil.GetIntArrayFromString(hfSelectedTitle); AddEntities2 <TitleUser>(titleIDs, CurrentUser.ID); } DB.Users.Add(CurrentUser); await DB.SaveChangesAsync(); // 关闭本窗体(触发窗体的关闭事件) ActiveWindow.HidePostBack(); } return(UIHelper.Result()); }
public async Task <IActionResult> OnPostDeptNew_btnSaveClose_ClickAsync() { if (ModelState.IsValid) { // 下拉列表的顶级节点值为-1 if (Dept.ParentID == -1) { Dept.ParentID = null; } DB.Depts.Add(Dept); await DB.SaveChangesAsync(); // 关闭本窗体(触发窗体的关闭事件) ActiveWindow.HidePostBack(); } return(UIHelper.Result()); }
public async Task <IActionResult> OnPostMenuNew_btnSaveClose_ClickAsync(string ViewPowerName) { if (ModelState.IsValid) { // 下拉列表的顶级节点值为-1 if (Menu.ParentID == -1) { Menu.ParentID = null; } if (String.IsNullOrEmpty(ViewPowerName)) { Menu.ViewPowerID = null; } else { var viewPower = await DB.Powers .Where(p => p.Name == ViewPowerName) .FirstOrDefaultAsync(); if (viewPower != null) { Menu.ViewPowerID = viewPower.ID; } else { Alert.Show("浏览权限 " + ViewPowerName + " 不存在!"); return(UIHelper.Result()); } } DB.Menus.Add(Menu); await DB.SaveChangesAsync(); // 关闭本窗体(触发窗体的关闭事件) ActiveWindow.HidePostBack(); } return(UIHelper.Result()); }
public ActionResult btnCloseServer_Click() { ActiveWindow.HidePostBack(); return(UIHelper.Result()); }
public ActionResult IFrameWindow2_Button1_Click() { ActiveWindow.HidePostBack(); return(UIHelper.Result()); }