public List <BroadcastStatusModelRobi> GetBroadcastStatusRobi(int?page, int?limit, string sortBy, string direction, string searchString, out int total)
        {
            string sqlQuery = " EXEC spBroadcastStatusRobi ";

            IDataReader dr = objDAL.GetDataReader(sqlQuery, KeyConstant.Server_Sahbox_17);
            List <BroadcastStatusModelRobi> OperatorDataList = new List <BroadcastStatusModelRobi>();

            while (dr.Read())
            {
                BroadcastStatusModelRobi objBroadcastStatusModel = new BroadcastStatusModelRobi();

                objBroadcastStatusModel.RowID      = Convert.ToString(dr["RowID"], null);
                objBroadcastStatusModel.Processing = Convert.ToString(dr["Processing"], null);
                objBroadcastStatusModel.Port       = Convert.ToString(dr["Port"], null);
                objBroadcastStatusModel.Status     = Convert.ToString(dr["Status"], null);

                OperatorDataList.Add(objBroadcastStatusModel);
            }

            total = OperatorDataList.Count();
            var records = OperatorDataList.Select(a => a);



            if (!string.IsNullOrWhiteSpace(searchString))
            {
                // records = OperatorDataList.Where(p => p.KEYWORD.Contains(searchString) || p.SERVICE_ID.Contains(searchString));
            }

            if (!string.IsNullOrEmpty(sortBy) && !string.IsNullOrEmpty(direction))
            {
                if (direction.Trim().ToLower() == "asc")
                {
                    //records = SortHelper.OrderBy(records, sortBy);
                }
                else
                {
                    // records = SortHelper.OrderByDescending(records, sortBy);
                }
            }

            if (page.HasValue && limit.HasValue)
            {
                int start = (page.Value - 1) * limit.Value;
                records = records.Skip(start).Take(limit.Value);
            }

            return(records.ToList());
        }
        public List <ServiceDetailsModel> GetDeatilRecords(int?page, int?limit, string sortBy, string direction, string searchString, out int total)
        {
            string sqlQuery = " SELECT a.KEYWORD,a.SERVICE_NAME, a.SERVICE_ID, b.REPLY_SCRIPT_ON, b.REPLY_SCRIPT_OFF, b.SUBSCRIPTION_CODE "
                              + " FROM tbl_Key_Map_Master a "
                              + " INNER JOIN tbl_Key_Map_Subscription b ON a.SERVICE_ID=b.SERVICE_ID "
                              + " ORDER BY a.KEYWORD ";

            IDataReader dr = objDAL.GetDataReader(sqlQuery, KeyConstant.Server_Sahbox_17_Blink);
            List <ServiceDetailsModel> OperatorDataList = new List <ServiceDetailsModel>();

            while (dr.Read())
            {
                ServiceDetailsModel objServiceOperatorModel = new ServiceDetailsModel();

                objServiceOperatorModel.KEYWORD           = Convert.ToString(dr["KEYWORD"], null);
                objServiceOperatorModel.SERVICE_NAME      = Convert.ToString(dr["SERVICE_NAME"], null);
                objServiceOperatorModel.SERVICE_ID        = Convert.ToString(dr["SERVICE_ID"], null);
                objServiceOperatorModel.REPLY_SCRIPT_ON   = Convert.ToString(dr["REPLY_SCRIPT_ON"], null);
                objServiceOperatorModel.REPLY_SCRIPT_OFF  = Convert.ToString(dr["REPLY_SCRIPT_OFF"], null);
                objServiceOperatorModel.SUBSCRIPTION_CODE = Convert.ToString(dr["SUBSCRIPTION_CODE"], null);

                OperatorDataList.Add(objServiceOperatorModel);
            }

            total = OperatorDataList.Count();
            var records = OperatorDataList.Select(a => a);



            if (!string.IsNullOrWhiteSpace(searchString))
            {
                records = OperatorDataList.Where(p => p.KEYWORD.Contains(searchString) || p.SERVICE_ID.Contains(searchString));
            }

            if (!string.IsNullOrEmpty(sortBy) && !string.IsNullOrEmpty(direction))
            {
                if (direction.Trim().ToLower() == "asc")
                {
                    //records = SortHelper.OrderBy(records, sortBy);
                }
                else
                {
                    // records = SortHelper.OrderByDescending(records, sortBy);
                }
            }

            if (page.HasValue && limit.HasValue)
            {
                int start = (page.Value - 1) * limit.Value;
                records = records.Skip(start).Take(limit.Value);
            }

            return(records.ToList());
        }
Пример #3
0
        public IEnumerable <DropDownListModel> GetDataList(string ExcelID)
        {
            string sqlQuery = " EXEC spGetExcelSheetName '" + ExcelID + "' ";

            IDataReader dr = objDAL.GetDataReader(sqlQuery, KeyConstant.Server_Sahbox_17);
            List <DropDownListModel> objList = new List <DropDownListModel>();

            while (dr.Read())
            {
                DropDownListModel objDropDownListModel = new DropDownListModel();

                objDropDownListModel.SheetID   = Convert.ToString(dr["id"], null);
                objDropDownListModel.SheetName = Convert.ToString(dr["SheetNameShow"], null);

                objList.Add(objDropDownListModel);
            }

            //total = objAirtelModelList.Count();
            var records = objList.Select(a => a);

            return(records);
        }
Пример #4
0
        public List <ServiceOperatorModel> GetRecords(int?page, int?limit, string sortBy, string direction, string searchString, out int total)
        {
            string      sqlQuery = " EXEC spGetServiceList ";
            IDataReader dr       = objDAL.GetDataReader(sqlQuery, KeyConstant.Server_Sahbox_17);
            List <ServiceOperatorModel> OperatorDataList = new List <ServiceOperatorModel>();

            while (dr.Read())
            {
                ServiceOperatorModel objServiceOperatorModel = new ServiceOperatorModel();

                objServiceOperatorModel.Live     = Convert.ToString(dr["Live"], null);
                objServiceOperatorModel.Expired  = Convert.ToString(dr["Expired"], null);
                objServiceOperatorModel.Operator = Convert.ToString(dr["Operator"], null);

                OperatorDataList.Add(objServiceOperatorModel);
            }

            total = OperatorDataList.Count();
            var records = OperatorDataList.Select(a => a);



            if (!string.IsNullOrWhiteSpace(searchString))
            {
                records = OperatorDataList.Where(p => p.Operator.Contains(searchString) || p.Live.Contains(searchString));
            }

            if (!string.IsNullOrEmpty(sortBy) && !string.IsNullOrEmpty(direction))
            {
                if (direction.Trim().ToLower() == "asc")
                {
                    //records = SortHelper.OrderBy(records, sortBy);
                }
                else
                {
                    // records = SortHelper.OrderByDescending(records, sortBy);
                }
            }

            if (page.HasValue && limit.HasValue)
            {
                int start = (page.Value - 1) * limit.Value;
                records = records.Skip(start).Take(limit.Value);
            }

            return(records.ToList());
        }
        public List <AirtelModel> GetUploadedData(int SheetID, string ContentMonth, string ContentYear, int?page, int?limit, string sortBy, string direction, string searchString, out int total)
        {
            string sqlQuery = " EXEC spContentUploadDataRead " + SheetID + ",'" + ContentMonth + "','" + ContentYear + "'";

            IDataReader        dr = objDAL.GetDataReader(sqlQuery, KeyConstant.Server_Sahbox_17);
            List <AirtelModel> objAirtelModelList = new List <AirtelModel>();

            while (dr.Read())
            {
                AirtelModel objAirtelModel = new AirtelModel();

                objAirtelModel.ExcelFileName = "Excel Name";
                objAirtelModel.ContentDate   = Convert.ToString(dr["Content_Date"], null);
                objAirtelModel.TextLen       = Convert.ToInt32(dr["Text_Len"], null);
                objAirtelModel.ContentText   = Convert.ToString(dr["Content_Text"], null);
                objAirtelModel.UploadStatus  = Convert.ToString(dr["Status"], null);
                objAirtelModel.ContentCode   = Convert.ToString(dr["Code"], null);
                if (SheetID == 80)
                {
                    objAirtelModel.HorosCopeCode = Convert.ToString(dr["HoroscopeCode"], null);
                    objAirtelModel.HorosCopeName = Convert.ToString(dr["HoroscopeName"], null);
                }
                objAirtelModelList.Add(objAirtelModel);
            }

            total = objAirtelModelList.Count();
            var records = objAirtelModelList.Select(a => a);

            if (!string.IsNullOrWhiteSpace(searchString))
            {
                // records = OperatorDataList.Where(p => p.KEYWORD.Contains(searchString) || p.SERVICE_ID.Contains(searchString));
            }

            if (!string.IsNullOrEmpty(sortBy) && !string.IsNullOrEmpty(direction))
            {
                if (direction.Trim().ToLower() == "asc")
                {
                    //records = SortHelper.OrderBy(records, sortBy);
                }
                else
                {
                    // records = SortHelper.OrderByDescending(records, sortBy);
                }
            }

            if (page.HasValue && limit.HasValue)
            {
                int start = (page.Value - 1) * limit.Value;
                records = records.Skip(start).Take(limit.Value);
            }

            return(records.ToList());
        }