public ActionResult SettingEvt(int[] SettingID, string Action) { // You have your books IDs on the deleteInputs array switch (Action.ToLower()) { case "delete": if (SettingID != null && SettingID.Length > 0) { int length = SettingID.Length; Setting objItem; for (int i = 0; i <= length - 1; i++) { objItem = SettingManager.GetById(SettingID[i], CurrentUser.CompanyID); if (objItem != null) { SettingManager.Delete(objItem); } } return(View(ViewFolder + "list.cshtml", SettingManager.GetAll(CurrentUser.CompanyID))); } break; } return(View("PostFrm")); }
private void InitComboBox() { Cursor.Current = Cursors.WaitCursor; settingBindingSource.DataSource = SettingManager.GetAll(); positionBindingSource.DataSource = PositionManager.GetAll(); leaveTypeBindingSource.DataSource = LeaveTypeManager.GetAll(); Cursor.Current = Cursors.Default; }
/// <summary> /// ExportExcel File /// </summary> /// <returns></returns> public string ExportExcel() { SettingCollection collection = SettingManager.GetAll(CurrentUser.CompanyID); DataTable dt = collection.ToDataTable <Setting>(); string fileName = "Setting_" + SystemConfig.CurrentDate.ToString("MM-dd-yyyy"); string[] RemoveColumn = { "CompanyID", "TargetDisplayID", "ReturnDisplay", "TotalRecord", "CreatedUser", "CreatedDate" }; for (int i = 0; i < RemoveColumn.Length; i++) { if (dt.Columns.Contains(RemoveColumn[i])) { dt.Columns.Remove(RemoveColumn[i]); } } FileInputHelper.ExportExcel(dt, fileName, "Setting List", false); return(fileName); }
public ActionResult Create(Setting model) { try { if (ModelState.IsValid) { model.CompanyID = CurrentUser.CompanyID; if (model.SettingID != 0) { //get default value Setting objOldSetting = SettingManager.GetById(model.SettingID, CurrentUser.CompanyID); if (objOldSetting != null) { model.CreatedDate = objOldSetting.CreatedDate; model.CreatedUser = objOldSetting.CreatedUser; } SettingManager.Update(model); } else { // TODO: Add insert logic here //model.CreatedUser = CurrentUser.UserName; model.CreatedDate = SystemConfig.CurrentDate; SettingManager.Add(model); } return(View(ViewFolder + "list.cshtml", SettingManager.GetAll(CurrentUser.CompanyID))); } } catch (Exception ObjEx) { // LogHelper.AddLog(new IfindLog() {LinkUrl=Request.Url.AbsoluteUri,Exception= ObjEx.Message,Message = ObjEx.StackTrace}); return(View(model)); } return(View(model)); }
private void LoadInitData() { Cursor.Current = Cursors.WaitCursor; settingBindingSource.DataSource = SettingManager.GetAll(); Cursor.Current = Cursors.Default; }
public ActionResult list() { SettingCollection collection = SettingManager.GetAll(CurrentUser.CompanyID); return(View(ViewFolder + "list.cshtml", collection)); }