Ejemplo n.º 1
0
 /// <summary>
 /// Get the list of records to be shown n the database
 /// </summary>
 /// <param name="skip">no. of records to be Skipped</param>
 /// <param name="take">no. of records to be Retrieved</param>
 /// <param name="page">page no</param>
 /// <param name="pageSize">size of the page i.e. No of record to be displayed at once</param>
 /// <param name="sort">column no according to which records are to be Ordered</param>
 /// <param name="filter">values/parameter according to which record are to be Filtered</param>
 /// <returns></returns>
 public DataSourceResult GetGridData(int skip, int take, int page, int pageSize, List <GridSort> sort, GridFilter filter)
 {
     try
     {
         string         sorts      = GridSort.ProcessSorting(sort);
         string         filters    = GridFilter.ProcessFilters <RateGlobalDueCarrier>(filter);
         SqlParameter[] Parameters = { new SqlParameter("@PageNo", page), new SqlParameter("@PageSize", pageSize), new SqlParameter("@WhereCondition", filters), new SqlParameter("@OrderBy", sorts) };
         DataSet        ds         = SqlHelper.ExecuteDataset(ReadConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "GetListRateGlobalDueCarrier", Parameters);
         var            RateGlobalDueCarrierList = ds.Tables[0].AsEnumerable().Select(e => new RateGlobalDueCarrier
         {
             SNo                = Convert.ToInt32(e["SNo"]),
             Airline            = Convert.ToString(e["Airline"]),
             OriginAirPort      = Convert.ToString(e["OriginAirPort"]),
             DestinationAirPort = Convert.ToString(e["DestinationAirport"]),
             OriginCountry      = Convert.ToString(e["OriginCountry"]),
             DestinationCountry = Convert.ToString(e["DestinationCountry"]),
             OriginIATA         = Convert.ToString(e["OriginIATA"]),
             DestinationIATA    = Convert.ToString(e["DestinationIATA"]),
             Active             = Convert.ToString(e["Active"]),
         });
         ds.Dispose();
         return(new DataSourceResult
         {
             Data = RateGlobalDueCarrierList.AsQueryable().ToList(),
             Total = Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString())
         });
     }
     catch (Exception ex)//
     {
         throw ex;
     }
 }
Ejemplo n.º 2
0
        public DataSourceResult GetGridData(int skip, int take, int page, int pageSize, List <GridSort> sort, GridFilter filter)
        {
            try
            {
                string         sorts                  = GridSort.ProcessSorting(sort);
                string         filters                = GridFilter.ProcessFilters <IrregularityStatus>(filter);
                SqlParameter[] Parameters             = { new SqlParameter("@PageNo", page), new SqlParameter("@PageSize", pageSize), new SqlParameter("@WhereCondition", filters), new SqlParameter("@OrderBy", sorts) };
                DataSet        ds                     = SqlHelper.ExecuteDataset(DMLConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "GetListIrregularityStatus", Parameters);
                var            IrregularityStatusList = ds.Tables[0].AsEnumerable().Select(e => new IrregularityStatus
                {
                    SNo = Convert.ToInt32(e["SNo"]),

                    Status   = e["Status"].ToString().ToUpper(),
                    IsActive = Convert.ToBoolean(e["IsActive"]),
                    Active   = e["Active"].ToString().ToUpper(),
                    //CreatedBy = e["CreatedBy"].ToString(),
                    //CreatedOn = e["CreatedOn"].ToString()
                });
                ds.Dispose();
                return(new DataSourceResult
                {
                    Data = IrregularityStatusList.AsQueryable().ToList(),
                    Total = Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString())
                });
            }
            catch (Exception ex)//
            {
                throw new System.ServiceModel.Web.WebFaultException <string>("Bad Request.", HttpStatusCode.BadRequest);
            }
        }
Ejemplo n.º 3
0
 public DataSourceResult GetGridData(int skip, int take, int page, int pageSize, List <GridSort> sort, GridFilter filter)
 {
     try
     {
         string         sorts      = GridSort.ProcessSorting(sort);
         string         filters    = GridFilter.ProcessFilters <Ledger>(filter);
         SqlParameter[] Parameters = { new SqlParameter("@PageNo", page), new SqlParameter("@PageSize", pageSize), new SqlParameter("@WhereCondition", filters), new SqlParameter("@OrderBy", sorts) };
         DataSet        ds         = SqlHelper.ExecuteDataset(ReadConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "GetListLedger", Parameters);
         var            LedgerList = ds.Tables[0].AsEnumerable().Select(e => new Ledger
         {
             SNo        = Convert.ToInt32(e["SNo"]),
             LedgerCode = e["LedgerCode"].ToString().ToUpper(),
             LedgerName = e["LedgerName"].ToString().ToUpper(),
             Payable    = Convert.ToString(e["Payable"]),
         });
         ds.Dispose();
         return(new DataSourceResult
         {
             Data = LedgerList.AsQueryable().ToList(),
             Total = Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString())
         });
     }
     catch (Exception ex)//(Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 4
0
        public DataSourceResult GetGridData(int skip, int take, int page, int pageSize, List <GridSort> sort, GridFilter filter)
        {
            try
            {
                string sorts   = GridSort.ProcessSorting(sort);
                string filters = GridFilter.ProcessFilters <FlightGridData>(filter);

                SqlParameter[] Parameters = { new SqlParameter("@PageNo", page), new SqlParameter("@PageSize", pageSize), new SqlParameter("@WhereCondition", filters), new SqlParameter("@OrderBy", sorts) };
                DataSet        ds         = SqlHelper.ExecuteDataset(DMLConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "GetListFlightTransfer", Parameters);
                var            FTList     = ds.Tables[0].AsEnumerable().Select(e => new FlightGridData
                {
                    FlightNo   = e["FlightNo"].ToString().ToUpper(),
                    FlightDate = e["FlightDate"].ToString().ToUpper(),
                    ETDETA     = e["ETDETA"].ToString().ToUpper(),
                    Origin     = e["Origin"].ToString(),
                    Dest       = e["Dest"].ToString(),
                    Atype      = e["Atype"].ToString(),
                    Route      = e["Route"].ToString(),
                    TCapacity  = e["TCapacity"].ToString().ToUpper(),
                    ACapacity  = e["ACapacity"].ToString(),
                    UCapacity  = e["UCapacity"].ToString(),
                    FStatus    = e["FStatus"].ToString()
                });
                ds.Dispose();
                return(new DataSourceResult
                {
                    Data = FTList.AsQueryable().ToList(),
                    Total = Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString())
                });
            }
            catch (Exception ex)//
            {
                throw ex;
            }
        }
Ejemplo n.º 5
0
        public DataSourceResult GetGridData(int skip, int take, int page, int pageSize, List <GridSort> sort, GridFilter filter)
        {
            int    UserSNo = CustomizedGrid.UserSNo;
            string sorts   = GridSort.ProcessSorting(sort);
            string filters = GridFilter.ProcessFilters <UserGroup>(filter); // Change by akash bcz filter is not getting due to wrong class

            SqlParameter[] Parameters = { new SqlParameter("@PageNo", page), new SqlParameter("@PageSize", pageSize), new SqlParameter("@WhereCondition", filters), new SqlParameter("@OrderBy", sorts), new SqlParameter("@UserSNo", UserSNo) };
            DataSet        ds         = SqlHelper.ExecuteDataset(DMLConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "GetListUserGroup", Parameters);

            var pageList = ds.Tables[0].AsEnumerable().Select(e => new UserGroup
            {
                //MSNo = Convert.ToInt32(e["MSNo"]),
                SNo       = Convert.ToInt32(e["SNo"]),
                UserName  = e["UserName"].ToString(),
                GroupName = e["GroupName"].ToString(),
                UserSNo   = Convert.ToInt32(e["UserSNo"].ToString()),
                GroupSNo  = Convert.ToInt32(e["GroupSNo"].ToString())
            });

            ds.Dispose();
            return(new DataSourceResult
            {
                Data = pageList.AsQueryable().ToList(),
                Total = Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString())
            });
        }
Ejemplo n.º 6
0
 public DataSourceResult GetGridData(int skip, int take, int page, int pageSize, List <SoftwareFactory.Data.GridSort> sort, SoftwareFactory.Data.GridFilter filter)
 {
     try
     {
         string         sorts            = GridSort.ProcessSorting(sort);
         string         filters          = GridFilter.ProcessFilters <InvVehicleService>(filter);
         string         connectionString = CargoFlash.SoftwareFactory.Data.DMLConnectionString.WebConfigConnectionString.ToString();
         SqlParameter[] Parameters       = { new SqlParameter("@PageNo", page), new SqlParameter("@PageSize", pageSize), new SqlParameter("@WhereCondition", filters), new SqlParameter("@OrderBy", sorts) };
         DataSet        ds = SqlHelper.ExecuteDataset(connectionString, CommandType.StoredProcedure, "GetListInvVehicleService", Parameters);
         var            InvVehicleServiceList = ds.Tables[0].AsEnumerable().Select(e => new CargoFlash.Cargo.Model.Inventory.InvVehicleService
         {
             SNo                     = Convert.ToInt32(e["SNo"]),
             Text_VehicleSNo         = e["Text_VehicleSNo"].ToString().ToUpper(),
             RegistrationNo          = e["RegistrationNo"].ToString().ToUpper(),
             Text_VehicleServiceType = e["Text_VehicleServiceType"].ToString().ToUpper(),
             ServicedOn              = DateTime.Parse(e["ServicedOn"].ToString()),
             NextServiceDueOn        = DateTime.Parse(e["NextServiceDueOn"].ToString()),
             IsActive                = Convert.ToBoolean(e["IsActive"])
         });
         ds.Dispose();
         return(new DataSourceResult
         {
             Data = InvVehicleServiceList.AsQueryable().ToList(),
             Total = Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString())
         });
     }
     catch (Exception ex)//
     {
         throw ex;
     }
 }
        public DataSourceResult GetGridData(int skip, int take, int page, int pageSize, List <GridSort> sort, GridFilter filter)
        {
            try
            {
                string         sorts       = GridSort.ProcessSorting(sort);
                string         filters     = GridFilter.ProcessFilters <ApprovePaymentGridData>(filter);
                SqlParameter[] Parameters  = { new SqlParameter("@PageNo", page), new SqlParameter("@PageSize", pageSize), new SqlParameter("@WhereCondition", filters), new SqlParameter("@OrderBy", sorts), new SqlParameter("@UserSNo", ((CargoFlash.Cargo.Model.UserLogin)(System.Web.HttpContext.Current.Session["UserDetail"])).UserSNo.ToString()) };
                DataSet        ds          = SqlHelper.ExecuteDataset(ReadConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "GetListVerifyPayment", Parameters);
                var            TaxRateList = ds.Tables[0].AsEnumerable().Select(e => new ApprovePaymentGridData
                {
                    SNo         = Convert.ToString(e["SNo"]),
                    OfficeSNo   = Convert.ToInt32(e["OfficeSNo"]),
                    Office      = e["Office"].ToString().ToUpper(),
                    Agent       = Convert.ToString(e["Agent"]).ToUpper(),
                    Credit      = Convert.ToString(e["Credit"]),
                    Amount      = Convert.ToString(e["Amount"]),
                    UpdateType  = Convert.ToString(e["UpdateType"]),
                    Transaction = Convert.ToString(e["Transaction"]),
                    RefNo       = e["RefNo"].ToString()
                });

                ds.Dispose();
                return(new DataSourceResult
                {
                    Data = TaxRateList.AsQueryable().ToList(),
                    Total = Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString())
                });
            }
            catch (Exception ex)//(Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 8
0
        public DataSourceResult GetGridData(int skip, int take, int page, int pageSize, List <GridSort> sort, GridFilter filter)
        {
            try
            {
                string sorts   = GridSort.ProcessSorting(sort);
                string filters = GridFilter.ProcessFilters <HoldType>(filter);

                SqlParameter[] Parameters   = { new SqlParameter("@PageNo", page), new SqlParameter("@PageSize", pageSize), new SqlParameter("@WhereCondition", filters), new SqlParameter("@OrderBy", sorts) };
                DataSet        ds           = SqlHelper.ExecuteDataset(DMLConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "GetListHoldType", Parameters);
                var            HoldTypeList = ds.Tables[0].AsEnumerable().Select(e => new HoldType
                {
                    SNo           = Convert.ToInt32(e["SNo"]),
                    Hold_Type     = e["Hold_Type"].ToString().ToUpper(),
                    HoldTypeCode  = e["HoldTypeCode"].ToString().ToUpper(),
                    AutoHold      = e["AutoHold"].ToString(),
                    HoldMessage   = e["HoldMessage"].ToString().ToUpper(),
                    UnHoldMessage = e["UnHoldMessage"].ToString().ToUpper(),
                    RestrictChangeFinalization = e["RestrictChangeFinalization"].ToString().ToUpper(),
                    Active            = e["Active"].ToString().ToUpper(),
                    Text_IsAutoUnhold = e["Text_IsAutoUnhold"].ToString().ToUpper(),
                });
                ds.Dispose();
                return(new DataSourceResult
                {
                    Data = HoldTypeList.AsQueryable().ToList(),
                    Total = Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString())
                });
            }
            catch (Exception ex)//
            {
                throw ex;
            }
        }
Ejemplo n.º 9
0
        public DataSourceResult GetOfficeData(int skip, int take, int page, int pageSize, List <GridSort> sort, GridFilter filter)
        {
            try
            {
                string         sorts      = GridSort.ProcessSorting(sort);
                string         filters    = GridFilter.ProcessFilters <CargoFlash.Cargo.Model.Stock.AWBStockStatus>(filter);
                SqlParameter[] Parameters = { new SqlParameter("@PageNo",         page),    new SqlParameter("@PageSize", pageSize),
                                              new SqlParameter("@WhereCondition", filters), new SqlParameter("@OrderBy",  sorts) };

                DataSet ds = SqlHelper.ExecuteDataset(ReadConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "sp_AwbStockStatus_GetOfficeRecord", Parameters);

                var CommodityList = ds.Tables[0].AsEnumerable().Select(e => new CargoFlash.Cargo.Model.Stock.AWBStockStatus
                {
                    CitySNo             = Convert.ToInt32(e["CitySNo"].ToString()),
                    Name                = e["Name"].ToString().ToUpper(),
                    TotalStockIssued    = Convert.ToInt32(e["TotalStockIssued"]),
                    StockUnused         = Convert.ToInt32(e["StockUnused"]),
                    StockIssuedToOffice = Convert.ToInt32(e["StockIssuedToOffice"])
                });
                ds.Dispose();
                return(new DataSourceResult
                {
                    Data = CommodityList.AsQueryable().ToList(),
                    //Total = Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString())
                });
            }
            catch (Exception ex)//
            {
                throw ex;
            }
        }
Ejemplo n.º 10
0
 public DataSourceResult GetGridData(int skip, int take, int page, int pageSize, List <GridSort> sort, GridFilter filter)
 {
     try
     {
         string         sorts       = GridSort.ProcessSorting(sort);
         string         filters     = GridFilter.ProcessFilters <SummaryReport>(filter);
         SqlParameter[] Parameters  = { new SqlParameter("@PageNo", page), new SqlParameter("@PageSize", pageSize), new SqlParameter("@WhereCondition", filters), new SqlParameter("@OrderBy", sorts), new SqlParameter("@LoginUserSNo", ((CargoFlash.Cargo.Model.UserLogin)(System.Web.HttpContext.Current.Session["UserDetail"])).UserSNo) };
         DataSet        ds          = SqlHelper.ExecuteDataset(DMLConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "GetListSummaryReport", Parameters);
         var            SummaryList = ds.Tables[0].AsEnumerable().Select(e => new SummaryReport
         {
             SNo               = Convert.ToInt32(e["SNo"]),
             CashierId         = e["CashierId"].ToString().ToUpper(),
             CashierName       = e["CashierName"].ToString(),
             CashRegisterDate  = e["CashRegisterDate"].ToString() == String.Empty ? "" : DateTime.Parse(e["CashRegisterDate"].ToString()).ToString("dd-MMM-yyyy"),
             StartSession      = e["StartSession"] == DBNull.Value ? (DateTime?)null : DateTime.SpecifyKind(Convert.ToDateTime(e["StartSession"]), DateTimeKind.Utc),
             EndSession        = e["EndSession"] == DBNull.Value ? (DateTime?)null : DateTime.SpecifyKind(Convert.ToDateTime(e["EndSession"]), DateTimeKind.Utc),
             Startbalance      = e["Startbalance"].ToString().ToUpper(),
             ClosingBalance    = e["ClosingBalance"].ToString().ToUpper(),
             ShiftStart        = e["StartShift"] == DBNull.Value ? (DateTime?)null : DateTime.SpecifyKind(Convert.ToDateTime(e["StartShift"]), DateTimeKind.Utc),
             ShiftEnd          = e["EndShift"] == DBNull.Value ? (DateTime?)null : DateTime.SpecifyKind(Convert.ToDateTime(e["EndShift"]), DateTimeKind.Utc),
             CashierIDGroupSNo = e["CashierIDGroupSNo"].ToString(),
             cashregisterSNo   = e["cashregisterSNo"].ToString()
         });
         ds.Dispose();
         return(new DataSourceResult
         {
             Data = SummaryList.AsQueryable().ToList(),
             Total = Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString())
         });
     }
     catch (Exception ex)//(Exception ex)
     {
         throw ex;
     }
 }
 /// <summary>
 ///  Get list of the records to be shown in the grid
 /// </summary>
 /// <param name="skip">nos. of records to be Skipped</param>
 /// <param name="take">nos. of records to be Retrieved</param>
 /// <param name="page">page no</param>
 /// <param name="pageSize">Size of the page i.e. No of record to be displayed</param>
 /// <param name="sort">column no according to which records to be ordered</param>
 /// <param name="filter">values/parameter According to which record are filtered</param>
 /// <returns>List of the records</returns>
 public DataSourceResult GetGridData(int skip, int take, int page, int pagesize, List <GridSort> sort, GridFilter filter)
 {
     try
     {
         string         sorts               = GridSort.ProcessSorting(sort);
         string         filters             = GridFilter.ProcessFilters <CityConnectionTime>(filter);
         SqlParameter[] Parameters          = { new SqlParameter("@PageNo", page), new SqlParameter("@PageSize", pagesize), new SqlParameter("@WhereCondition", filters), new SqlParameter("@OrderBy", sorts) };
         DataSet        ds                  = SqlHelper.ExecuteDataset(DMLConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "GetListAirlineTimeZone", Parameters);
         var            AirlineTimeZoneList = ds.Tables[0].AsEnumerable().Select(e => new AirlineTimeZone
         {
             SNo            = Convert.ToInt32(e["SNo"].ToString()),
             TimeZoneName   = e["TimeZoneName"].ToString().ToUpper(),
             TimeDifference = Convert.ToInt32(e["TimeDifference"]),
             prefix         = Convert.ToString(e["Prefix"]),
             Hour           = Convert.ToInt32(e["Hour"]),
             Minute         = Convert.ToInt32(e["Minute"]),
             UpdatedBy      = e["UpdatedBy"].ToString()
         });
         ds.Dispose();
         return(new DataSourceResult
         {
             Data = AirlineTimeZoneList.AsQueryable().ToList(),
             Total = Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString())
         });
     }
     catch (Exception ex)//
     {
         throw ex;
     }
 }
Ejemplo n.º 12
0
        // get data in grid
        public DataSourceResult GetGridData(int skip, int take, int page, int pageSize, List <GridSort> sort, GridFilter filter)
        {
            try
            {
                string         sorts      = GridSort.ProcessSorting(sort);
                string         filters    = GridFilter.ProcessFilters <ApplicationEntityGrid>(filter);
                SqlParameter[] Parameters = { new SqlParameter("@PageNo",         page),    new SqlParameter("@PageSize", pageSize),
                                              new SqlParameter("@WhereCondition", filters), new SqlParameter("@OrderBy",  sorts) };

                DataSet ds = SqlHelper.ExecuteDataset(ReadConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "GetApplicationEntityList", Parameters);

                var ApplicationEntityList = ds.Tables[0].AsEnumerable().Select(e => new ApplicationEntityGrid
                {
                    SNo             = Convert.ToInt32(e["SNo"]),
                    ApplicationCode = e["ApplicationCode"].ToString(),
                    ApplicationName = e["ApplicationName"].ToString(),
                    Remarks         = e["Remarks"].ToString(),
                    IsActive        = e["IsActive"].ToString().ToString()
                });
                ds.Dispose();
                return(new DataSourceResult
                {
                    Data = ApplicationEntityList.AsQueryable().ToList(),
                    Total = Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString()),
                    FilterCondition = filters,
                    SortCondition = sorts,
                    StoredProcedure = "GetApplicationEntityList"
                });
            }
            catch (Exception ex)//
            {
                throw ex;
            }
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Get the list of records to be shown n the database
        /// </summary>
        /// <param name="skip">no. of records to be Skipped</param>
        /// <param name="take">no. of records to be Retrieved</param>
        /// <param name="page">page no</param>
        /// <param name="pageSize">size of the page i.e. No of record to be displayed at once</param>
        /// <param name="sort">column no according to which records are to be Ordered</param>
        /// <param name="filter">values/parameter according to which record are to be Filtered</param>
        /// <returns></returns>
        public DataSourceResult GetGridData(int skip, int take, int page, int pageSize, List <GridSort> sort, GridFilter filter)
        {
            try
            {
                string sorts   = GridSort.ProcessSorting(sort);
                string filters = GridFilter.ProcessFilters <HandOverCutOffTime>(filter);

                SqlParameter[] Parameters = { new SqlParameter("@PageNo", page), new SqlParameter("@PageSize", pageSize), new SqlParameter("@WhereCondition", filters), new SqlParameter("@OrderBy", sorts) };
                DataSet        ds         = SqlHelper.ExecuteDataset(DMLConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "GetListHandOverCutOffTime", Parameters);

                var HandOverCutOffTimeList = ds.Tables[0].AsEnumerable().Select(e => new HandOverCutOffTime
                {
                    SNo                 = Convert.ToInt32(e["SNo"]),
                    BucketClassSNo      = e["BucketClassSNo"].ToString(),
                    Text_BucketClassSNo = e["Name"].ToString(),
                    CityCode            = e["CityCode"].ToString(),
                    Text_CityCode       = e["CityCode"].ToString(),
                    HandOverCutoffTime  = Convert.ToInt32(e["HandOverCutoffTime"]),
                    Name                = e["Name"].ToString()
                });
                ds.Dispose();
                return(new DataSourceResult

                {
                    Data = HandOverCutOffTimeList.AsQueryable().ToList(),
                    Total = Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString())
                });
            }
            catch (Exception ex)//
            {
                throw ex;
            }
        }
 public DataSourceResult GetGridData(int skip, int take, int page, int pageSize, List <GridSort> sort, GridFilter filter)
 {
     try
     {
         string         sorts                = GridSort.ProcessSorting(sort);
         string         filters              = GridFilter.ProcessFilters <IssueConsumables>(filter);
         SqlParameter[] Parameters           = { new SqlParameter("@PageNo", page), new SqlParameter("@PageSize", pageSize), new SqlParameter("@WhereCondition", filters), new SqlParameter("@OrderBy", sorts) };
         DataSet        ds                   = SqlHelper.ExecuteDataset(ReadConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "GetListIssueConsumables", Parameters);
         var            IssueConsumablesList = ds.Tables[0].AsEnumerable().Select(e => new IssueConsumables
         {
             SNo        = e["SNo"].ToString(),
             Item       = e["Item"].ToString(),
             IssuedType = e["IssuedType"].ToString(),
             IssuedTo   = e["IssuedTo"].ToString(),
             NoOfItem   = Convert.ToInt32(e["NoOfItem"].ToString()),
             // IssuedDate=e["IssuedDate"].ToString(),
             IssuedDate = e["IssuedDate"] == DBNull.Value ? (DateTime?)null : DateTime.SpecifyKind(Convert.ToDateTime(e["IssuedDate"]), DateTimeKind.Utc),
             Type       = e["Type"].ToString()
         });
         ds.Dispose();
         return(new DataSourceResult
         {
             Data = IssueConsumablesList.AsQueryable().ToList(),
             Total = Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString())
         });
     }
     catch (Exception ex)//
     {
         throw ex;
     }
 }
Ejemplo n.º 15
0
        public DataSourceResult GetGridUserGroupsData2(int skip, int take, int page, int pageSize, List <GridSort> sort, GridFilter filter)
        {
            int    UserSNo = CustomizedGrid.UserSNo;
            string sorts   = GridSort.ProcessSorting(sort);
            string filters = GridFilter.ProcessFilters <Groups>(filter);

            SqlParameter[] Parameters = { new SqlParameter("@PageNo", page), new SqlParameter("@PageSize", pageSize), new SqlParameter("@WhereCondition", filters), new SqlParameter("@OrderBy", sorts), new SqlParameter("@UserSNo", UserSNo) };
            DataSet        ds         = SqlHelper.ExecuteDataset(DMLConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "GetListUserGroups2", Parameters);

            var userList = ds.Tables[0].AsEnumerable().Select(e => new Groups
            {
                //MSNo = Convert.ToInt32(e["MSNo"]),
                SNo       = Convert.ToInt32(e["SNo"]),
                GroupName = e["GroupName"].ToString(),
                IsActive  = Convert.ToBoolean(e["IsActive"].ToString()),
                Active    = e["Active"].ToString()
            });

            ds.Dispose();
            return(new DataSourceResult
            {
                Data = userList.AsQueryable().ToList(),
                Total = Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString())
            });
        }
Ejemplo n.º 16
0
        /*
         *****************************************************************************
         * I Name:		      EmailAlert
         * Purpose:
         * Company:		      CargoFlash Infotech Pvt Ltd.
         * Author:			  Sushant Kumar Nayak
         * Created On:		  22-01-2018
         * Updated By:
         * Updated On:
         * Approved By:
         * Approved On:
         *****************************************************************************
         */

        public DataSourceResult GetGridData(int EmailAlertSNo, int skip, int take, int page, int pageSize, List <GridSort> sort, GridFilter filter)
        {
            string sorts            = GridSort.ProcessSorting(sort);
            string filters          = GridFilter.ProcessFilters <EmailAlert>(filter);
            string connectionString = ConfigurationManager.AppSettings["DBMSClientString"].ToString();

            SqlParameter[] Parameters = { new SqlParameter("@PageNo", page), new SqlParameter("@PageSize", pageSize), new SqlParameter("@WhereCondition", filters), new SqlParameter("@OrderBy", sorts) };
            DataSet        ds         = SqlHelper.ExecuteDataset(CargoFlash.SoftwareFactory.Data.DMLConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "Get_EmailAlert", Parameters);

            var EmailAlert = ds.Tables[0].AsEnumerable().Select(e => new EmailAlert
            {
                SNo         = Convert.ToInt32(e["SNo"]),
                AirlineName = e["AirlineName"].ToString(),
                Process     = e["Process"].ToString(),
                CityCountry = e["CityCountry"].ToString(),
                frequency   = e["frequency"].ToString().ToUpper(),
                intervals   = e["intervals"].ToString(),
            });

            ds.Dispose();
            return(new DataSourceResult
            {
                Data = EmailAlert.AsQueryable().ToList(),
                Total = Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString())
            });
        }
Ejemplo n.º 17
0
        public DataSourceResult GetActiveGroupGridData(int skip, int take, int page, int pageSize, List <GridSort> sort, GridFilter filter)
        {
            string sorts   = GridSort.ProcessSorting(sort);
            string filters = GridFilter.ProcessFilters <Groups>(filter);

            SqlParameter[] Parameters = { new SqlParameter("@PageNo",   page),
                                          new SqlParameter("@UserSNo",  ((CargoFlash.Cargo.Model.UserLogin)(System.Web.HttpContext.Current.Session["UserDetail"])).UserSNo),
                                          new SqlParameter("@PageSize", pageSize),                                                                                          new SqlParameter("@WhereCondition",filters), new SqlParameter("@OrderBy", sorts) };
            DataSet        ds = SqlHelper.ExecuteDataset(DMLConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "GetListActiveGroups", Parameters);

            var userList = ds.Tables[0].AsEnumerable().Select(e => new Groups
            {
                //MSNo = Convert.ToInt32(e["MSNo"]),
                SNo       = Convert.ToInt32(e["SNo"]),
                GroupName = e["GroupName"].ToString(),
                Active    = e["Active"].ToString(),
                IsActive  = Convert.ToBoolean(e["IsActive"].ToString())
            });

            ds.Dispose();
            return(new DataSourceResult
            {
                Data = userList.AsQueryable().ToList(),
                Total = Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString())
            });
        }
        /// <summary>
        ///  Get list of the records to be shown in the grid
        /// </summary>
        /// <param name="skip">nos. of records to be Skipped</param>
        /// <param name="take">nos. of records to be Retrieved</param>
        /// <param name="page">page no</param>
        /// <param name="pageSize">Size of the page i.e. No of record to be displayed</param>
        /// <param name="sort">column no according to which records to be ordered</param>
        /// <param name="filter">values/parameter According to which record are filtered</param>
        /// <returns>List of the records</returns>
        public DataSourceResult GetGridData(int skip, int take, int page, int pageSize, List <GridSort> sort, GridFilter filter)
        {
            try
            {
                string sorts   = GridSort.ProcessSorting(sort);
                string filters = GridFilter.ProcessFilters <DocumentMaster>(filter);

                SqlParameter[] Parameters         = { new SqlParameter("@PageNo", page), new SqlParameter("@PageSize", pageSize), new SqlParameter("@WhereCondition", filters), new SqlParameter("@OrderBy", sorts) };
                DataSet        ds                 = SqlHelper.ExecuteDataset(DMLConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "GetListDocumentMaster", Parameters);
                var            DocumentMasterList = ds.Tables[0].AsEnumerable().Select(e => new DocumentMaster
                {
                    SNo          = Convert.ToInt32(e["SNo"].ToString()),
                    DocumentName = e["DocumentName"].ToString().ToUpper(),
                    Description  = e["Description"].ToString().ToUpper(),

                    Active = e["Active"].ToString().ToUpper(),

                    UpdatedBy = e["UpdatedUser"].ToString().ToUpper()
                });
                ds.Dispose();
                return(new DataSourceResult
                {
                    Data = DocumentMasterList.AsQueryable().ToList(),
                    Total = Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString())
                });
            }
            catch (Exception ex)//
            {
                throw ex;
            }
        }
Ejemplo n.º 19
0
        /// <summary>
        /// Get grid data
        /// Created By : Jasmine Kaur Sethi
        /// Created On : 29 APR 2013
        /// </summary>
        /// <param name="skip"></param>
        /// <param name="take"></param>
        /// <param name="page"></param>
        /// <param name="pageSize"></param>
        /// <param name="sort"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public DataSourceResult GetGridData(int skip, int take, int page, int pageSize, List <GridSort> sort, GridFilter filter)
        {
            string sorts   = GridSort.ProcessSorting(sort);
            string filters = GridFilter.ProcessFilters <VehicleTypeGridData>(filter);

            SqlParameter[] Parameters = { new SqlParameter("@PageNo", page), new SqlParameter("@PageSize", pageSize), new SqlParameter("@WhereCondition", filters), new SqlParameter("@OrderBy", sorts) };
            DataSet        ds         = SqlHelper.ExecuteDataset(ReadConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "GetListVehicleMake", Parameters);

            var VehicleMakeList = ds.Tables[0].AsEnumerable().Select(e => new VehicleMakeGridData
            {
                SNo         = Convert.ToInt32(e["SNo"]),
                vehicletype = e["vehicletype"].ToString(),
                vehiclemake = e["vehiclemake"].ToString(),
                // Capacity = Convert.ToInt64(e["Capacity"]),
                Capacity = e["Capacity"].ToString(),
                Active   = e["Active"].ToString()
            });

            ds.Dispose();
            return(new DataSourceResult
            {
                Data = VehicleMakeList.AsQueryable().ToList(),
                Total = Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString()),
                FilterCondition = filters,
                SortCondition = sorts,
                StoredProcedure = "GetListVehicleMake"
            });
        }
Ejemplo n.º 20
0
        public DataSourceResult GetGridData(int skip, int take, int page, int pageSize, List <GridSort> sort, GridFilter filter)
        {
            try
            {
                string sorts   = GridSort.ProcessSorting(sort);
                string filters = GridFilter.ProcessFilters <DueCarrier>(filter);

                SqlParameter[] Parameters     = { new SqlParameter("@PageNo", page), new SqlParameter("@PageSize", pageSize), new SqlParameter("@WhereCondition", filters), new SqlParameter("@OrderBy", sorts) };
                DataSet        ds             = SqlHelper.ExecuteDataset(DMLConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "GetListDueCarrier", Parameters);
                var            DueCarrierList = ds.Tables[0].AsEnumerable().Select(e => new DueCarrier
                {
                    SNo             = Convert.ToInt32(e["SNo"]),
                    Code            = e["Code"].ToString().ToUpper(),
                    Name            = e["Name"].ToString().ToUpper(),
                    TempFreightType = e["TempFreightType"].ToString().ToUpper(),
                    Carrier         = e["Carrier"].ToString().ToUpper(),
                    Mandatory       = e["Mandatory"].ToString().ToUpper(),
                    Active          = e["Active"].ToString().ToUpper(),
                    Editable        = e["Editable"].ToString().ToUpper(),
                    ShowOnCSR       = e["ShowOnCSR"].ToString().ToUpper(),
                });
                ds.Dispose();
                return(new DataSourceResult
                {
                    Data = DueCarrierList.AsQueryable().ToList(),
                    Total = Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString())
                });
            }
            catch (Exception ex)//(Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 21
0
        public DataSourceResult GetGridData(int skip, int take, int page, int pageSize, List <GridSort> sort, GridFilter filter)
        {
            try
            {
                string sorts   = GridSort.ProcessSorting(sort);
                string filters = GridFilter.ProcessFilters <EDoxGrid>(filter);

                SqlParameter[] Parameters = { new SqlParameter("@PageNo", page), new SqlParameter("@PageSize", pageSize), new SqlParameter("@WhereCondition", filters), new SqlParameter("@OrderBy", sorts) };
                DataSet        ds         = SqlHelper.ExecuteDataset(DMLConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "GetListEDox", Parameters);
                var            EDoxList   = ds.Tables[0].AsEnumerable().Select(e => new EDoxGrid
                {
                    SNo             = Convert.ToInt32(e["SNo"].ToString()),
                    DocumentName    = e["DocumentName"].ToString().ToUpper(),
                    ApplicableInTxt = e["ApplicableInTxt"].ToString().ToUpper(),
                    UpdatedBy       = e["UpdatedBy"].ToString().ToUpper(),
                    UpdatedOn       = e["UpdatedOn"] == DBNull.Value ? (DateTime?)null : DateTime.SpecifyKind(Convert.ToDateTime(e["UpdatedOn"]), DateTimeKind.Utc),
                    IsActiveTxt     = e["IsActiveTxt"].ToString().ToUpper(),
                });
                ds.Dispose();
                return(new DataSourceResult
                {
                    Data = EDoxList.AsQueryable().ToList(),
                    Total = Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString())
                });
            }
            catch (Exception ex)//
            {
                throw ex;
            }
        }
        public DataSourceResult GetGridData(int skip, int take, int page, int pageSize, List <GridSort> sort, GridFilter filter)
        {
            try
            {
                string sorts   = GridSort.ProcessSorting(sort);
                string filters = GridFilter.ProcessFilters <RateSurcharge>(filter);

                SqlParameter[] Parameters        = { new SqlParameter("@PageNo", page), new SqlParameter("@PageSize", pageSize), new SqlParameter("@WhereCondition", filters), new SqlParameter("@OrderBy", sorts) };
                DataSet        ds                = SqlHelper.ExecuteDataset(DMLConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "GetListRateSurcharge", Parameters);
                var            RateSurchargeList = ds.Tables[0].AsEnumerable().Select(e => new RateSurcharge
                {
                    SNo                   = Convert.ToInt32(e["SNo"]),
                    SurchargeName         = e["SurchargeName"].ToString().ToUpper(),
                    Text_SurchargeTypeSNo = e["Text_SurchargeTypeSNo"].ToString().ToUpper(),
                    Text_OriginSNo        = e["Text_OriginSNo"].ToString().ToUpper(),
                    Text_ProductSNo       = e["Text_ProductSNo"].ToString().ToUpper(),
                    ValidFrom             = e["ValidFrom"] == DBNull.Value ? (DateTime?)null : DateTime.SpecifyKind(Convert.ToDateTime(e["ValidFrom"]), DateTimeKind.Utc),
                    ValidTo               = e["ValidTo"] == DBNull.Value ? (DateTime?)null : DateTime.SpecifyKind(Convert.ToDateTime(e["ValidTo"]), DateTimeKind.Utc)

                                            //Active = e["Active"].ToString().ToUpper(),
                });
                ds.Dispose();
                return(new DataSourceResult
                {
                    Data = RateSurchargeList.AsQueryable().ToList(),
                    Total = Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString())
                });
            }
            catch (Exception ex)//
            {
                throw ex;
            }
        }
Ejemplo n.º 23
0
 {/// <summary>
     ///  Get list of the records to be shown in the grid
     /// </summary>
     /// <param name="skip">nos. of records to be Skipped</param>
     /// <param name="take">nos. of records to be Retrieved</param>
     /// <param name="page">page no</param>
     /// <param name="pageSize">Size of the page i.e. No of record to be displayed</param>
     /// <param name="sort">column no according to which records to be ordered</param>
     /// <param name="filter">values/parameter According to which record are filtered</param>
     /// <returns>List of the records</returns>
     public DataSourceResult GetGridData(int skip, int take, int page, int pageSize, List <GridSort> sort, GridFilter filter)
     {
         try
         {
             string         sorts           = GridSort.ProcessSorting(sort);
             string         filters         = GridFilter.ProcessFilters <AccountType>(filter);
             SqlParameter[] Parameters      = { new SqlParameter("@PageNo", page), new SqlParameter("@PageSize", pageSize), new SqlParameter("@WhereCondition", filters), new SqlParameter("@OrderBy", sorts) };
             DataSet        ds              = SqlHelper.ExecuteDataset(DMLConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "GetListAccountType", Parameters);
             var            AccountTypeList = ds.Tables[0].AsEnumerable().Select(e => new AccountType
             {
                 SNo             = Convert.ToInt32(e["SNo"].ToString()),
                 AccountTypeName = e["AccountTypeName"].ToString().ToUpper(),
                 //PrefixCode=e["PrefixCode"].ToString().ToUpper(),
                 Text_ProductSNo = e["Text_ProductSNo"].ToString().ToUpper(),
                 Active          = e["Active"].ToString().ToUpper(),//foriegn key
                 Airline         = e["Airline"].ToString().ToUpper(),
                 UpdatedBy       = e["UpdatedUser"].ToString().ToUpper(),
                 CreatedBy       = e["CreatedUser"].ToString().ToUpper()
             });
             ds.Dispose();
             return(new DataSourceResult
             {
                 Data = AccountTypeList.AsQueryable().ToList(),
                 Total = Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString())
             });
         }
         catch (Exception ex)//
         {
             throw ex;
         }
     }
Ejemplo n.º 24
0
        public DataSourceResult GetGridData(int skip, int take, int page, int pageSize, List <GridSort> sort, GridFilter filter)
        {
            try
            {
                string sorts   = GridSort.ProcessSorting(sort);
                string filters = GridFilter.ProcessFilters <RegistryControl>(filter);

                SqlParameter[] Parameters = { new SqlParameter("@PageNo", page), new SqlParameter("@PageSize", pageSize), new SqlParameter("@WhereCondition", filters), new SqlParameter("@OrderBy", sorts) };
                DataSet        ds         = SqlHelper.ExecuteDataset(DMLConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "GetListTaskArea", Parameters);
                var            TAList     = ds.Tables[0].AsEnumerable().Select(e => new TaskArrea
                {
                    SNo       = Convert.ToInt32(e["SNo"].ToString()),
                    TaskName  = e["TaskName"].ToString().ToUpper(),
                    AreaName  = e["AreaName"].ToString().ToUpper(),
                    TIsActive = true,
                });
                ds.Dispose();
                return(new DataSourceResult
                {
                    Data = TAList.AsQueryable().ToList(),
                    Total = Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString())
                });
            }
            catch (Exception ex)//
            {
                throw ex;
            }
        }
Ejemplo n.º 25
0
        public DataSourceResult GetGridData(int skip, int take, int page, int pageSize, List <GridSort> sort, GridFilter filter)
        {
            string sorts   = GridSort.ProcessSorting(sort);
            string filters = GridFilter.ProcessFilters <Contacts>(filter);

            try
            {
                SqlParameter[] Parameters   = { new SqlParameter("@PageNo", page), new SqlParameter("@PageSize", pageSize), new SqlParameter("@WhereCondition", filters), new SqlParameter("@OrderBy", sorts) };
                DataSet        ds           = SqlHelper.ExecuteDataset(DMLConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "GetListContacts", Parameters);
                var            ContactsList = ds.Tables[0].AsEnumerable().Select(e => new Contacts
                {
                    SNo = Convert.ToInt32(e["SNo"]),
                    ContactsTypeName = e["ContactsTypeName"].ToString(),
                    ContactsTypeDis  = e["ContactsTypeDis"].ToString(),
                    Name             = e["Name"].ToString(),
                    DepartmentName   = e["DepartmentName"].ToString().ToUpper(),
                    PersonName       = e["PersonName"].ToString(),
                    Email            = e["Email"].ToString(),
                    Mobile           = e["Mobile"].ToString(),
                    Phone            = e["Phone"].ToString(),
                    Primary          = e["Primary"].ToString(),
                    Active           = e["Active"].ToString()
                });
                ds.Dispose();
                return(new DataSourceResult
                {
                    Data = ContactsList.AsQueryable().ToList(),
                    Total = Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString())
                });
            }
            catch (Exception ex)//
            {
                throw ex;
            }
        }
Ejemplo n.º 26
0
        public DataSourceResult GetGridData(int skip, int take, int page, int pageSize, List <GridSort> sort, GridFilter filter)
        {
            string sorts   = GridSort.ProcessSorting(sort);
            string filters = GridFilter.ProcessFilters <Allocation>(filter);

            SqlParameter[] Parameters     = { new SqlParameter("@PageNo", page), new SqlParameter("@PageSize", pageSize), new SqlParameter("@WhereCondition", filters), new SqlParameter("@OrderBy", sorts) };
            DataSet        ds             = SqlHelper.ExecuteDataset(DMLConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "GetListAllocationAccount", Parameters);
            var            AllocationList = ds.Tables[0].AsEnumerable().Select(e => new AllocationAccount
            {
                SNo         = Convert.ToInt32(e["SNo"].ToString()),
                ProductSNo  = e["ProductSNo"].ToString(),
                ProductName = e["ProductName"].ToString(),
                AccountSNo  = e["AccountSNo"].ToString(),
                //  Text_AccountSNo = e["Name"].ToString(),
                AccountAllocationCode = e["AccountAllocationCode"].ToString(),
                GrossWeight           = Convert.ToDecimal(e["GrossWeight"]),
                VolumeWeight          = Convert.ToDecimal(e["VolumeWeight"]),
                ReleaseTime           = e["ReleaseTime"].ToString(),
                StartDate             = Convert.ToDateTime(e["StartDate"]).ToString("dd-MMM-yyyy"),
                EndDate = Convert.ToDateTime(e["EndDate"]).ToString("dd-MMM-yyyy")
            });

            ds.Dispose();
            return(new DataSourceResult
            {
                Data = AllocationList.AsQueryable().ToList(),
                Total = Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString())
            });
        }
Ejemplo n.º 27
0
        public DataSourceResult GetGridChildData(int skip, int take, int page, int pageSize, List <GridSort> sort, GridFilter filter)
        {
            string sorts   = GridSort.ProcessSorting(sort);
            string filters = GridFilter.ProcessFilters <Pages>(filter);

            SqlParameter[] Parameters = { new SqlParameter("@PageNo", page), new SqlParameter("@PageSize", pageSize), new SqlParameter("@WhereCondition", filters), new SqlParameter("@OrderBy", sorts) };
            DataSet        ds         = SqlHelper.ExecuteDataset(DMLConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "GetListModulePage", Parameters);

            var pageList = ds.Tables[0].AsEnumerable().Select(e => new Pages
            {
                MSNo         = Convert.ToInt32(e["MSNo"]),
                SNo          = Convert.ToInt32(e["SNo"]),
                PageName     = e["PageName"].ToString(),
                Hyperlink    = e["Hyperlink"].ToString(),
                MenuSNo      = Convert.ToInt32(e["MenuSNo"].ToString()),
                DisplayOrder = Convert.ToInt32(e["DisplayOrder"].ToString()),
                Help         = e["Help"].ToString(),
                Description  = e["Description"].ToString(),
                IsActive     = Convert.ToBoolean(e["IsActive"].ToString())
            });

            ds.Dispose();
            return(new DataSourceResult
            {
                Data = pageList.AsQueryable().ToList(),
                Total = Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString())
            });
        }
Ejemplo n.º 28
0
 public SoftwareFactory.Data.DataSourceResult GetGridData(int skip, int take, int page, int pageSize, List <SoftwareFactory.Data.GridSort> sort, SoftwareFactory.Data.GridFilter filter)
 {
     try
     {
         string         sorts                = GridSort.ProcessSorting(sort);
         string         filters              = GridFilter.ProcessFilters <InvVehicle>(filter);
         SqlParameter[] Parameters           = { new SqlParameter("@PageNo", page), new SqlParameter("@PageSize", pageSize), new SqlParameter("@WhereCondition", filters), new SqlParameter("@OrderBy", sorts) };
         DataSet        ds                   = SqlHelper.ExecuteDataset(DMLConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "GetListInvVehicle", Parameters);
         var            InventoryVehTypeList = ds.Tables[0].AsEnumerable().Select(e => new InvVehicle
         {
             SNo = Convert.ToInt32(e["SNo"]),
             Text_VehicleTypeSNo = e["Text_VehicleType"].ToString().ToUpper(),
             ManufactureDate     = DateTime.Parse(e["ManufactureDate"].ToString()),
             EngineNo            = e["EngineNo"].ToString().ToUpper(),
             ChasisNo            = e["ChasisNo"].ToString().ToUpper(),
             RegistrationNo      = e["RegistrationNo"].ToString().ToUpper(),
             DateofPurchase      = DateTime.Parse(e["DateofPurchase"].ToString()),
             VehicleType         = e["VehicleType"].ToString().ToUpper(),
             PurchasedFrom       = e["PurchasedFrom"].ToString().ToUpper(),
             CostOfVehicle       = Convert.ToDecimal(e["CostOfVehicle"]),
             CityCode            = e["CityCode"].ToString().ToUpper(),
             IsActive            = Convert.ToBoolean(e["IsActive"])
         });
         ds.Dispose();
         return(new DataSourceResult
         {
             Data = InventoryVehTypeList.AsQueryable().ToList(),
             Total = Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString())
         });
     }
     catch (Exception ex)//
     {
         throw ex;
     }
 }
Ejemplo n.º 29
0
        /// <summary>
        /// Get all records for grid data
        /// Created By :Devendra
        /// Created On :15 JAN 2019
        /// </summary>
        /// <param name="skip"></param>
        /// <param name="take"></param>
        /// <param name="page"></param>
        /// <param name="pageSize"></param>
        /// <param name="sort"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public DataSourceResult GetGridData(int skip, int take, int page, int pageSize, List <GridSort> sort, GridFilter filter)
        {
            string sorts   = GridSort.ProcessSorting(sort);
            string filters = GridFilter.ProcessFilters <BannerGridData>(filter);

            SqlParameter[] Parameters = { new SqlParameter("@PageNo", page), new SqlParameter("@PageSize", pageSize), new SqlParameter("@WhereCondition", filters), new SqlParameter("@OrderBy", sorts) };
            DataSet        ds         = SqlHelper.ExecuteDataset(ReadConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "GetListBanner", Parameters);

            var BannerList = ds.Tables[0].AsEnumerable().Select(e => new BannerGridData
            {
                SNo           = Convert.ToInt32(e["SNo"]),
                BannerSubject = e["BannerSubject"].ToString(),
                Active        = e["Active"].ToString(),
                Title         = e["Title"].ToString(),
                BannerType    = e["BannerType"].ToString(),
                CreatedUser   = e["CreatedUser"].ToString(),
                UpdatedUser   = e["UpdatedUser"].ToString(),
            });

            ds.Dispose();
            return(new DataSourceResult
            {
                Data = BannerList.AsQueryable().ToList(),
                Total = Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString()),
                FilterCondition = filters,
                SortCondition = sorts,
                StoredProcedure = "GetListBanner"
            });
        }
 public DataSourceResult GetGridData(int skip, int take, int page, int pageSize, List <SoftwareFactory.Data.GridSort> sort, SoftwareFactory.Data.GridFilter filter)
 {
     try
     {
         string         sorts             = GridSort.ProcessSorting(sort);
         string         filters           = GridFilter.ProcessFilters <InventoryItem>(filter);
         SqlParameter[] Parameters        = { new SqlParameter("@PageNo", page), new SqlParameter("@PageSize", pageSize), new SqlParameter("@WhereCondition", filters), new SqlParameter("@OrderBy", sorts) };
         DataSet        ds                = SqlHelper.ExecuteDataset(DMLConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "GetListInventoryItem", Parameters);
         var            InventoryItemList = ds.Tables[0].AsEnumerable().Select(e => new InventoryItem
         {
             SNo      = Convert.ToInt32(e["SNo"]),
             ItemName = e["ItemName"].ToString().ToUpper(),
             //CreatedOn = Convert.ToDateTime(e["CreatedOn"]),
             // CreatedBy = Convert.ToString(e["CreatedBy"]),
             //   UpdatedBy = Convert.ToString(e["UpdatedBy"]),
             // UpdatedOn = Convert.ToDateTime(e["UpdatedOn"]),
             Active = e["Active"].ToString().ToUpper()
         });
         ds.Dispose();
         return(new DataSourceResult
         {
             Data = InventoryItemList.AsQueryable().ToList(),
             Total = Convert.ToInt32(ds.Tables[1].Rows[0][0].ToString())
         });
     }
     catch (Exception ex)//
     {
         throw ex;
     }
 }