Пример #1
0
        //Get Sub Device List
        public JsonResult GetSubDeviceList()
        {
            //jQuery DataTables Param
            var draw = Request.Form.GetValues("draw").FirstOrDefault();

            try
            {
                //Find paging info
                var start  = Request.Form.GetValues("start").FirstOrDefault();
                var length = Request.Form.GetValues("length").FirstOrDefault();
                //Find order columns info
                var sortColumn    = Request.Form.GetValues("columns[" + Request.Form.GetValues("order[0][column]").FirstOrDefault() + "][data]").FirstOrDefault();
                var sortColumnDir = Request.Form.GetValues("order[0][dir]").FirstOrDefault();
                var search        = Request.Form.Get("search[value]").FirstOrDefault();

                int pageSize = length != null?Convert.ToInt32(length) : 0, skip = start != null?Convert.ToInt16(start) : 1;

                skip = (skip / pageSize) + 1;
                COM.TTPagination.isPageing = true;
                COM.TTPagination.PageSize  = pageSize;
                COM.TTPagination.PageNo    = Convert.ToInt64(skip);
                lstEntity = objBAL.GetAll(search.ToString().Replace("\0", string.Empty));
                COM.ExtendedMethods.SortList(lstEntity, sortColumn, sortColumnDir);
            }
            catch (Exception ex)
            { GlobalVarible.AddError(ex.Message); }

            return(Json(new
            {
                draw = draw,
                recordsTotal = lstEntity.Count(),
                recordsFiltered = COM.TTPagination.RecordCount,
                data = lstEntity
            }, JsonRequestBehavior.AllowGet));
        }
Пример #2
0
 public CheckStatus()
 {
     objDashboard  = new BAL.DeviceDataBAL();
     objSubDevice  = new Josheph.Framework.BusinessLayer.SubDeviceMasterBAL();
     lstPlant      = new BAL.PlantMasterBAL().GetAll(string.Empty);
     lstSubDevices = objSubDevice.GetAll(string.Empty);
     objLastStatus = new Josheph.Framework.BusinessLayer.PlantDeviceLastStatus();
 }