public BaseServerSideData <ConferenceIndex> GetIndexPageManager(BaseDatatable baseDatatable)
        {
            var data = (from a in db.Papers
                        join b in db.RequestConferences on a.paper_id equals b.paper_id
                        join c in db.Conferences on b.conference_id equals c.conference_id
                        join d in db.BaseRequests on b.request_id equals d.request_id
                        join e in db.ConferenceStatusLanguages on b.status_id equals e.status_id
                        join f in db.Accounts on d.account_id equals f.account_id
                        where e.language_id == 1 && b.status_id != 5
                        select new ConferenceIndex
            {
                RequestID = d.request_id,
                PaperName = a.name,
                ConferenceName = c.conference_name,
                Date = d.created_date.Value,
                StatusName = e.name,
                FullName = f.full_name,
                StatusID = e.status_id
            })
                       .OrderBy(baseDatatable.SortColumnName + " " + baseDatatable.SortDirection)
                       .Skip(baseDatatable.Start).Take(baseDatatable.Length).ToList();

            int recordsTotal = (from b in db.RequestConferences
                                where b.status_id != 5
                                select b).Count();

            return(new BaseServerSideData <ConferenceIndex>(data, recordsTotal));
        }
        public JsonResult List()
        {
            BaseDatatable datatable = new BaseDatatable(Request);
            BaseServerSideData <ConferenceIndex> output = IndexRepos.GetIndexPageGuest(datatable, 6, LanguageResource.GetCurrentLanguageID());

            for (int i = 0; i < output.Data.Count; i++)
            {
                output.Data[i].RowNumber   = datatable.Start + 1 + i;
                output.Data[i].CreatedDate = output.Data[i].Date.ToString("dd/MM/yyyy");
            }
            return(Json(new { success = true, data = output.Data, draw = Request["draw"], recordsTotal = output.RecordsTotal, recordsFiltered = output.RecordsTotal }, JsonRequestBehavior.AllowGet));
        }
        public ActionResult getDatatable()
        {
            BaseDatatable baseDatatable = new BaseDatatable(Request);
            BaseServerSideData <RightRepo.infoRight> data = repo.getRights(baseDatatable);

            return(Json(new
            {
                success = true,
                data = data.Data,
                draw = Request["draw"],
                recordsTotal = data.RecordsTotal,
                recordsFiltered = data.RecordsTotal
            }));
        }
 public BaseServerSideData <ActivityExpenseType> getListActivityExpenseType(BaseDatatable baseDatatable)
 {
     try
     {
         using (ScienceAndInternationalAffairsEntities db = new ScienceAndInternationalAffairsEntities())
         {
             db.Configuration.LazyLoadingEnabled = false;
             List <ActivityExpenseType> activityExpenseTypes = db.Database.SqlQuery <ActivityExpenseType>("select * from SMIA_AcademicActivity.ActivityExpenseType " +
                                                                                                          "ORDER BY " + baseDatatable.SortColumnName + " " + baseDatatable.SortDirection +
                                                                                                          " OFFSET " + baseDatatable.Start + " ROWS FETCH NEXT " + baseDatatable.Length + " ROWS ONLY").ToList();
             int recordsTotal = db.Database.SqlQuery <int>("select count(*) from SMIA_AcademicActivity.ActivityExpenseType").FirstOrDefault();
             return(new BaseServerSideData <ActivityExpenseType>(activityExpenseTypes, recordsTotal));
         }
     }
     catch (Exception e)
     {
         throw e;
     }
 }
 public BaseServerSideData <InternalUnit> getListInternalUnit(BaseDatatable baseDatatable)
 {
     try
     {
         using (ScienceAndInternationalAffairsEntities db = new ScienceAndInternationalAffairsEntities())
         {
             db.Configuration.LazyLoadingEnabled = false;
             List <InternalUnit> internalUnits = db.Database.SqlQuery <InternalUnit>("select * from General.InternalUnit " +
                                                                                     "ORDER BY " + baseDatatable.SortColumnName + " " + baseDatatable.SortDirection +
                                                                                     " OFFSET " + baseDatatable.Start + " ROWS FETCH NEXT " + baseDatatable.Length + " ROWS ONLY").ToList();
             int recordsTotal = db.Database.SqlQuery <int>("select count(*) from General.InternalUnit").FirstOrDefault();
             return(new BaseServerSideData <InternalUnit>(internalUnits, recordsTotal));
         }
     }
     catch (Exception e)
     {
         throw e;
     }
 }
 public ActionResult listCollaborationScope()
 {
     try
     {
         BaseDatatable baseDatatable = new BaseDatatable(Request);
         BaseServerSideData <CollaborationScope> baseServerSideData = collaborationStatusRepo.getListCollaborationScope(baseDatatable);
         return(Json(new
         {
             success = true,
             data = baseServerSideData.Data,
             draw = Request["draw"],
             recordsTotal = baseServerSideData.RecordsTotal,
             recordsFiltered = baseServerSideData.RecordsTotal
         }, JsonRequestBehavior.AllowGet));
     }
     catch (Exception e)
     {
         return(Json(new { success = false }));
     }
 }
 public ActionResult listAcademicActivityType()
 {
     try
     {
         BaseDatatable baseDatatable = new BaseDatatable(Request);
         BaseServerSideData <AcademicActivityType> academicActivityTypes = academicActivityTypeRepo.getlistAcademicActivityType(baseDatatable);
         return(Json(new
         {
             success = true,
             data = academicActivityTypes.Data,
             draw = Request["draw"],
             recordsTotal = academicActivityTypes.RecordsTotal,
             recordsFiltered = academicActivityTypes.RecordsTotal
         }, JsonRequestBehavior.AllowGet));
     }
     catch (Exception e)
     {
         return(Json(new { success = false }));
     }
 }
예제 #8
0
 public BaseServerSideData <infoRight> getRights(BaseDatatable baseDatatable)
 {
     try
     {
         using (ScienceAndInternationalAffairsEntities db = new ScienceAndInternationalAffairsEntities())
         {
             db.Configuration.LazyLoadingEnabled = false;
             string sql = @"select r.right_id,r.right_name,m.module_name,r.group_id
                         from General.[Right] r inner join General.Module m on r.module_id = m.module_id 
                         ORDER BY " + baseDatatable.SortColumnName + " " + baseDatatable.SortDirection +
                          " OFFSET " + baseDatatable.Start + " ROWS FETCH NEXT " + baseDatatable.Length + " ROWS ONLY";
             int recordTotal       = db.Database.SqlQuery <int>("select count(*) from General.[Right] r inner join General.Module m on r.module_id = m.module_id").FirstOrDefault();
             List <infoRight> data = db.Database.SqlQuery <infoRight>(sql).ToList();
             return(new BaseServerSideData <infoRight>(data, recordTotal));
         }
     }
     catch (Exception e)
     {
         return(new BaseServerSideData <infoRight>(new List <infoRight>(), 0));
     }
 }
예제 #9
0
 public BaseServerSideData <AcademicCollaborationStatu_Ext> getListAcademicCollaborationStatu(BaseDatatable baseDatatable)
 {
     try
     {
         using (ScienceAndInternationalAffairsEntities db = new ScienceAndInternationalAffairsEntities())
         {
             db.Configuration.LazyLoadingEnabled = false;
             List <AcademicCollaborationStatu_Ext> academicCollaborationStatus = db.Database.SqlQuery <AcademicCollaborationStatu_Ext>(@"select collab_status_id, collab_status_name,
                                                                 CASE
                                                                 WHEN status_type = 1 THEN N'Dài hạn'
                                                                 WHEN status_type = 2 THEN N'Ngắn hạn'
                                                                 WHEN status_type = 3 THEN N'Dài hạn và ngắn hạn'
                                                                 END as 'status_type_name'
                                                                 from IA_AcademicCollaboration.AcademicCollaborationStatus " +
                                                                                                                                       "ORDER BY " + baseDatatable.SortColumnName + " " + baseDatatable.SortDirection +
                                                                                                                                       " OFFSET " + baseDatatable.Start + " ROWS FETCH NEXT " + baseDatatable.Length + " ROWS ONLY").ToList();
             int recordsTotal = db.Database.SqlQuery <int>("select count(*) from IA_AcademicCollaboration.AcademicCollaborationStatus").FirstOrDefault();
             return(new BaseServerSideData <AcademicCollaborationStatu_Ext>(academicCollaborationStatus, recordsTotal));
         }
     }
     catch (Exception e)
     {
         throw e;
     }
 }