Exemple #1
0
        public void DeleteById(object Id)
        {
            long lngID = long.Parse((string)Id);
            var  qry   = from t in CRMSystems
                         where t.SYSID == lngID
                         select t;
            var obj = qry.SingleOrDefault();

            CRMSystems.DeleteOnSubmit(obj);
            this.dataCtx.SubmitChanges();
        }
Exemple #2
0
        public IList <CRMSystem> SearchByCriteria(int CurrentPage, int PageSize, out int RecordCount, string Filter, string OrderBy)
        {
            if (OrderBy == "")
            {
                OrderBy = "SYSID";
            }

            var qry = from t in CRMSystems
                      .Where(Filter)
                      .OrderBy(OrderBy)
                      select t;

            RecordCount = qry.Count();

            if (CurrentPage == -1 || PageSize == -1)
            {
                return(qry.ToList());
            }
            else
            {
                return(qry.Skip(CurrentPage * PageSize).Take(PageSize).ToList());
            }
        }