public long TotalRecord(object whereClause) { try { using (AAASSOSRepository ASRepo = new AAASSOSRepository()) { return(ASRepo.RecordCount <AAASSOS>(whereClause)); } } catch (Exception ex) { throw ex; } }
public IEnumerable <AAASSOS> List() { try { using (AAASSOSRepository ASRepo = new AAASSOSRepository()) { return(ASRepo.GetList <AAASSOS>()); } } catch (Exception ex) { throw ex; } }
public bool Update(AAASSOS ASModel) { try { using (AAASSOSRepository ASRepo = new AAASSOSRepository()) { ASRepo.Update(ASModel); return(true); } } catch (Exception ex) { throw ex; } }
public AAASSOS GetById(int id) { try { using (AAASSOSRepository ASRepo = new AAASSOSRepository()) { AAASSOS ASModel = new AAASSOS(); { ASModel = ASRepo.Get <AAASSOS>(id); return(ASModel); } } } catch (Exception ex) { throw ex; } }
public AAASSOS Add(AAASSOS ASModel, int SubscriberId, string UserName) { try { using (AAASSOSRepository ASRepo = new AAASSOSRepository()) { if (ASModel != null) { ASModel.CreatedOn = Common.GetLocalDateTime(MemCache.GetFromCache <string>("Timezone_" + SubscriberId)); ASModel.CreatedBy = UserName; var rowId = ASRepo.Insert(ASModel); ASModel.Id = rowId; } return(ASModel); } } catch (Exception ex) { throw ex; } }
public bool Delete(int id) { try { using (AAASSOSRepository ASRepo = new AAASSOSRepository()) { var ASExisting = ASRepo.Get <AAASSOS>(id); if (ASExisting == null) { return(false); } else { ASRepo.Delete <AAASSOS>(id); return(true); } } } catch (Exception ex) { throw ex; } }
public DataTableModel ListPaged(Dictionary <string, string> dic = null) { try { string[] searchColumns = new string[] { "User_Contact_Number", "User_IMEI", "Address", "Created_By" }; DataTableModel dtModel = new DataTableModel(); Meta meta = new Meta(); if (dic.TryGetValue("pagination[page]", out string page)) { meta.page = Convert.ToInt64(page); } if (dic.TryGetValue("pagination[pages]", out string pages)) { meta.pages = Convert.ToInt64(pages); } if (dic.TryGetValue("pagination[perpage]", out string perpage)) { meta.perpage = Convert.ToInt64(perpage); } var parameters = this.ParseParameters(dic); using (AAASSOSRepository SosRepository = new AAASSOSRepository()) { dtModel.Data = SosRepository.GetListPaged <AAASSOS>(Convert.ToInt32(dic["pagination[page]"]), Convert.ToInt32(dic["pagination[perpage]"]), parameters, parameters["orderby"].ToString() + " " + parameters["sortorder"].ToString(), searchColumns); meta.total = SosRepository.RecordCount <AAASSOS>(parameters, searchColumns); } dtModel.Meta = meta; return(dtModel); } catch (Exception ex) { throw ex; } }