public ActionResult DeleteSec_StaffMarginLevel(int id, int idTable) { var db = new Sec_StaffMarginLevelDAL(); int LanguageCode = Global.CurrentUser.CurrentLanguageID; var result = db.DeleteSec_StaffMarginLevel(1, idTable, id, LanguageCode); return(Content(JsonConvert.SerializeObject(new { result }))); }
public ActionResult GetSec_StaffMarginLevelByAutoID(int id) { var db = new Sec_StaffMarginLevelDAL(); int LanguageCode = Global.CurrentUser.CurrentLanguageID; var result = db.GetSec_StaffMarginLevelByAutoID(id, LanguageCode); return(Content(JsonConvert.SerializeObject(new { result }))); }
public ActionResult ExportExcelSec_StaffMarginLevel(string filterString) { DataTable dt = new DataTable("Grid"); dt.Columns.AddRange(new DataColumn[8] { new DataColumn(AppRes.StaffLevelID), new DataColumn(AppRes.MinMargin), new DataColumn(AppRes.MaxMargin), new DataColumn(AppRes.CreatedOn), new DataColumn(AppRes.CreatedBy), new DataColumn(AppRes.Status), new DataColumn(AppRes.StartDate), new DataColumn(AppRes.EndDate) }); dt.Columns[0].DataType = typeof(int); dt.Columns[1].DataType = typeof(string); dt.Columns[2].DataType = typeof(string); dt.Columns[3].DataType = typeof(DateTime); dt.Columns[4].DataType = typeof(string); dt.Columns[5].DataType = typeof(string); dt.Columns[6].DataType = typeof(DateTime); dt.Columns[7].DataType = typeof(DateTime); var db = new Sec_StaffMarginLevelDAL(); int total = 0; int LanguageCode = Global.CurrentUser.CurrentLanguageID; var lstData = db.GetSec_StaffMarginLevel(1, 100, filterString, out total, LanguageCode); foreach (var item in lstData) { dt.Rows.Add(item.StaffLevelID, item.MinMarginMoney, item.MaxMarginMoney, item.CreatedOn, item.Fullname, item.StatusName, item.StartDate, item.EndDate); } var wb = new XLWorkbook(); wb.Worksheets.Add(dt); byte[] data = null; using (var stream = new MemoryStream()) { wb.SaveAs(stream); data = stream.ToArray(); } return(File(data, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "SecRole.xlsx")); }
public ActionResult TableServerSideGetData(int pageIndex, int pageSize, string filter = "") { var db = new Sec_StaffMarginLevelDAL(); int total = 0; int LanguageCode = Global.CurrentUser.CurrentLanguageID; var result = db.GetSec_StaffMarginLevel(pageIndex, pageSize, filter, out total, LanguageCode); var lstTotal = new TableColumnsTotalModel(); lstTotal.Total1 = "15"; lstTotal.Total2 = "25"; lstTotal.Total3 = "35"; return(Content(JsonConvert.SerializeObject(new { employees = result, totalCount = total, lstTotal = lstTotal }))); }
public ActionResult _SaveSec_StaffMarginLevel(Sec_StaffMarginLevel Sec_StaffMarginLevel) { var db = new Sec_StaffMarginLevelDAL(); var result = db.SaveSec_StaffMarginLevel(Sec_StaffMarginLevel); if (result.IsSuccess == true && Sec_StaffMarginLevel.AutoID == 0) { result.Message = AppRes.MSG_INSERT_SUCCESSFUL; } else if (result.IsSuccess == true && Sec_StaffMarginLevel.AutoID != 0) { result.Message = AppRes.MS_Update_success; } return(Content(JsonConvert.SerializeObject(new { result }))); }