예제 #1
0
 public long TotalRecord(object whereClause)
 {
     try
     {
         using (AAASSOSRepository ASRepo = new AAASSOSRepository())
         {
             return(ASRepo.RecordCount <AAASSOS>(whereClause));
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #2
0
 public IEnumerable <AAASSOS> List()
 {
     try
     {
         using (AAASSOSRepository ASRepo = new AAASSOSRepository())
         {
             return(ASRepo.GetList <AAASSOS>());
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #3
0
 public bool Update(AAASSOS ASModel)
 {
     try
     {
         using (AAASSOSRepository ASRepo = new AAASSOSRepository())
         {
             ASRepo.Update(ASModel);
             return(true);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #4
0
 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;
     }
 }
예제 #5
0
 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;
     }
 }
예제 #6
0
 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;
     }
 }
예제 #7
0
        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;
            }
        }