Example #1
0
        public async Task <IEnumerable <AuditTrailModel> > GetAuditTrailAsync(DateTime from, DateTime to, string terminal, string keyword)
        {
            var cmd = new SqlCommand();

            cmd.CommandText = StoredProcedure;
            cmd.Parameters.Clear();
            cmd.Parameters.AddWithValue("@DateFrom", from);
            cmd.Parameters.AddWithValue("@DateTo", to);
            cmd.Parameters.AddWithValue("@Keyword", keyword);
            cmd.Parameters.AddWithValue("@Terminal", terminal);
            var result = await SCObjects.ExecGetDataAsync(cmd, Properties.Settings.Default.UserConnectionString);

            var items = new List <AuditTrailModel>();

            if (result != null)
            {
                foreach (DataRow dr in result.Rows)
                {
                    var item = new AuditTrailModel
                    {
                        Id          = dr["Id"].ToString(),
                        Date        = dr["Date"].ToString(),
                        Description = dr["Description"].ToString(),
                        Gate        = dr["Gate"].ToString(),
                        Username    = dr["Username"].ToString(),
                    };
                    items.Add(item);
                }
            }

            return(items);
        }
Example #2
0
        public async Task <IEnumerable <ZReadingModel> > ZReadingAsync(DateTime dateFrom, DateTime dateTo, string terminal)
        {
            var        items = new List <ZReadingModel>();
            SqlCommand cmd   = new SqlCommand();

            cmd.CommandText = StoredProcedure;
            cmd.Parameters.Clear();
            cmd.Parameters.AddWithValue("@DateFrom", dateFrom);
            cmd.Parameters.AddWithValue("@DateTo", dateTo);
            cmd.Parameters.AddWithValue("@Terminal", terminal);
            var result = await SCObjects.ExecGetDataAsync(cmd, Properties.Settings.Default.UserConnectionString);

            if (result != null)
            {
                foreach (DataRow dr in result.Rows)
                {
                    var item = new ZReadingModel
                    {
                        Id         = dr["Id"].ToString(),
                        Date       = dr["Date"].ToString(),
                        NewORNo    = dr["NewORNo"].ToString(),
                        OldORNo    = dr["OldORNo"].ToString(),
                        OldFRNo    = dr["OldFRNo"].ToString(),
                        NewFRNo    = dr["NewFRNo"].ToString(),
                        TodaySales = dr["TodaySales"].ToString().Length == 0 ? 0 : decimal.Parse(dr["TodaySales"].ToString()),
                        OldSales   = dr["OldSales"].ToString().Length == 0 ? 0 : decimal.Parse(dr["OldSales"].ToString()),
                        NewSales   = dr["NewSales"].ToString().Length == 0 ? 0 : decimal.Parse(dr["NewSales"].ToString()),
                    };
                    items.Add(item);
                }
            }
            return(items);
        }
        public async Task <IEnumerable <OperationHourlyAccountabilityModel> > OperationHourlyAccountabilityAsync(DateTime from, DateTime to, string terminal)
        {
            var        items = new List <OperationHourlyAccountabilityModel>();
            SqlCommand cmd   = new SqlCommand();

            cmd.CommandText = StoredProcedure;
            cmd.Parameters.Clear();
            cmd.Parameters.AddWithValue("@DateFrom", from);
            cmd.Parameters.AddWithValue("@DateTo", to);
            cmd.Parameters.AddWithValue("@Terminal", terminal);
            var result = await SCObjects.ExecGetDataAsync(cmd, Properties.Settings.Default.UserConnectionString);

            if (result != null)
            {
                foreach (DataRow dr in result.Rows)
                {
                    var item = new OperationHourlyAccountabilityModel
                    {
                        RowNum           = int.Parse(dr["RowNum"].ToString()),
                        DurationHours    = dr["DurationHours"].ToString(),
                        NumberOfVehicles = int.Parse(dr["NumberOfVehicles"].ToString()),
                        Amount           = decimal.Parse(dr["Amount"].ToString()),
                    };
                    items.Add(item);
                }
            }
            return(items);
        }
        public async Task <IEnumerable <RemainingCarModel> > RemainingCarsAsync(DateTime date)
        {
            List <RemainingCarModel> items = new List <RemainingCarModel>();
            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = StoredProcedure;
            cmd.Parameters.Clear();
            cmd.Parameters.AddWithValue("@Date", date);
            var result = await SCObjects.ExecGetDataAsync(cmd, Properties.Settings.Default.UserConnectionString);

            if (result != null)
            {
                foreach (DataRow dr in result.Rows)
                {
                    var item = new RemainingCarModel
                    {
                        No           = dr["No"].ToString(),
                        ParkerType   = dr["ParkerType"].ToString(),
                        PlateNo      = dr["PlateNo"].ToString(),
                        RFIDName     = dr["RFIDName"].ToString(),
                        RFIDNumber   = dr["RFIDNumber"].ToString(),
                        TicketNumber = dr["TicketNumber"].ToString(),
                        TimeIn       = dr["TimeIn"].ToString(),
                    };
                    items.Add(item);
                }
            }
            return(items);
        }
Example #5
0
        public async Task <IEnumerable <CashlessSummaryModel> > CashlessSummaryAsync(DateTime from, DateTime to, string terminal)
        {
            var items = new List <CashlessSummaryModel>();
            var cmd   = new SqlCommand();

            cmd.CommandText = StoredProcedure;
            cmd.Parameters.Clear();
            cmd.Parameters.AddWithValue("@DateFrom", from);
            cmd.Parameters.AddWithValue("@DateTo", to);
            cmd.Parameters.AddWithValue("@Terminal", terminal);
            var result = await SCObjects.ExecGetDataAsync(cmd, Properties.Settings.Default.UserConnectionString);

            if (result == null)
            {
                return(null);
            }

            foreach (DataRow dr in result.Rows)
            {
                var item = new CashlessSummaryModel
                {
                    Id          = int.Parse(dr["Id"].ToString()),
                    Description = dr["Description"].ToString(),
                    Value       = dr["Value"].ToString(),
                };
                items.Add(item);
            }

            return(items);
        }
        public async Task <IEnumerable <SummaryReportPerTerminalModel> > SummaryReportPerTerminalAsync(DateTime from, DateTime to, string terminal)
        {
            var        items = new List <SummaryReportPerTerminalModel>();
            SqlCommand cmd   = new SqlCommand();

            cmd.CommandText = SummaryReportPerTerminal;
            cmd.Parameters.Clear();
            cmd.Parameters.AddWithValue("@DateFrom", from);
            cmd.Parameters.AddWithValue("@DateTo", to);
            cmd.Parameters.AddWithValue("@TerminalId", terminal);
            var result = await SCObjects.ExecGetDataAsync(cmd, Properties.Settings.Default.UserConnectionString);

            if (result != null)
            {
                foreach (DataRow dr in result.Rows)
                {
                    var item = new SummaryReportPerTerminalModel
                    {
                        Id          = dr["Id"].ToString(),
                        RunDate     = dr["RunDate"].ToString(),
                        RunTime     = dr["RunTime"].ToString(),
                        Date        = dr["Date"].ToString(),
                        Description = dr["Description"].ToString(),
                        Value       = dr["Value"].ToString(),
                        Location    = dr["Location"].ToString(),
                        Terminal    = dr["Terminal"].ToString(),
                    };
                    items.Add(item);
                }
            }
            return(items);
        }
Example #7
0
        public async Task <IEnumerable <OperationOccupancyModel> > OperationOccupancyReportAsync(DateTime date)
        {
            var items = new List <OperationOccupancyModel>();

            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = StoredProcedure;
            cmd.Parameters.Clear();
            cmd.Parameters.AddWithValue("@Date", date);
            var result = await SCObjects.ExecGetDataAsync(cmd, Properties.Settings.Default.UserConnectionString);

            if (result != null)
            {
                foreach (DataRow dr in result.Rows)
                {
                    var item = new OperationOccupancyModel
                    {
                        RowNum    = int.Parse(dr["RowNum"].ToString()),
                        Time      = dr["Time"].ToString(),
                        In        = int.Parse(dr["In"].ToString()),
                        Out       = int.Parse(dr["Out"].ToString()),
                        Remaining = int.Parse(dr["Remaining"].ToString()),
                    };
                    items.Add(item);
                }
            }
            return(items);
        }
        public async Task <IEnumerable <CardClearingModel> > CardClearingAsync(DateTime from, DateTime to, string terminal)
        {
            var items = new List <CardClearingModel>();
            var cmd   = new SqlCommand();

            cmd.CommandText = StoredProcedure;
            cmd.Parameters.Clear();
            cmd.Parameters.AddWithValue("@DateFrom", from);
            cmd.Parameters.AddWithValue("@DateTo", to);
            cmd.Parameters.AddWithValue("@Terminal", terminal);
            var result = await SCObjects.ExecGetDataAsync(cmd, Properties.Settings.Default.UserConnectionString);

            if (result != null)
            {
                foreach (DataRow dr in result.Rows)
                {
                    var item = new CardClearingModel
                    {
                        Id           = dr["Id"].ToString(),
                        Row          = dr["Row"].ToString(),
                        EntranceGate = dr["EntranceGate"].ToString(),
                        PlateNo      = dr["PlateNo"].ToString(),
                        TicketNo     = dr["TicketNo"].ToString(),
                        DateTimein   = dr["DateTimein"].ToString(),
                        Comment      = dr["Comment"].ToString(),
                        ClearedUser  = dr["ClearedUser"].ToString(),
                    };
                    items.Add(item);
                }
            }

            return(items);
        }
Example #9
0
        public async Task <IEnumerable <CardEncodingModel> > CardEncodingAsync(DateTime date, string keyword, string terminal)
        {
            var        items = new List <CardEncodingModel>();
            SqlCommand cmd   = new SqlCommand();

            cmd.CommandText = "[dbo].[spCardEncoding]";
            cmd.Parameters.Clear();
            cmd.Parameters.AddWithValue("@Date", date);
            cmd.Parameters.AddWithValue("@Keyword", keyword);
            cmd.Parameters.AddWithValue("@Terminal", terminal);
            var result = await SCObjects.ExecGetDataAsync(cmd, Properties.Settings.Default.UserConnectionString);

            if (result != null)
            {
                foreach (DataRow dr in result.Rows)
                {
                    var item = new CardEncodingModel
                    {
                        Id            = dr["Id"].ToString(),
                        EntranceGate  = dr["EntranceGate"].ToString(),
                        No            = dr["No"].ToString(),
                        PlateNo       = dr["PlateNo"].ToString(),
                        TimeIn        = dr["TimeIn"].ToString(),
                        TicketNumber  = dr["TicketNumber"].ToString(),
                        EntranceImage = dr["EntranceImage"].ToString().Length > 0 ? (byte[])dr["EntranceImage"] : null,
                    };
                    items.Add(item);
                }
            }
            return(items);
        }
        public async Task <IEnumerable <HourlyAccountabilityModel> > HourlyAccountabilityReportAsync(DateTime from, DateTime to, string terminal)
        {
            var items = new List <HourlyAccountabilityModel>();

            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = StoredProcedure;
            cmd.Parameters.Clear();
            cmd.Parameters.AddWithValue("@DateFrom", from);
            cmd.Parameters.AddWithValue("@DateTo", to);
            cmd.Parameters.AddWithValue("@Terminal", terminal);
            var result = await SCObjects.ExecGetDataAsync(cmd, Properties.Settings.Default.UserConnectionString);

            if (result != null)
            {
                foreach (DataRow dr in result.Rows)
                {
                    var item = new HourlyAccountabilityModel
                    {
                        TimeString  = dr["TimeString"].ToString(),
                        TotalCard   = int.Parse(dr["TotalCard"].ToString()),
                        TotalAmount = decimal.Parse(dr["TotalAmount"].ToString()),
                    };
                    items.Add(item);
                }
            }
            return(items);
        }
Example #11
0
        public async Task <IEnumerable <PeakLoadModel> > PeakLoadReportAsync(DateTime date)
        {
            var items = new List <PeakLoadModel>();

            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = StoredProcedure;
            cmd.Parameters.Clear();
            cmd.Parameters.AddWithValue("@Date", date);
            var result = await SCObjects.ExecGetDataAsync(cmd, Properties.Settings.Default.UserConnectionString);

            if (result != null)
            {
                foreach (DataRow dr in result.Rows)
                {
                    var item = new PeakLoadModel
                    {
                        Row           = int.Parse(dr["Row"].ToString()),
                        Time          = dr["Time"].ToString(),
                        GrossIn       = decimal.Parse(dr["GrossIn"].ToString()),
                        Cancel        = decimal.Parse(dr["Cancel"].ToString()),
                        NetIn         = decimal.Parse(dr["NetIn"].ToString()),
                        InPercentage  = decimal.Parse(dr["InPercentage"].ToString()),
                        NetOut        = decimal.Parse(dr["NetOut"].ToString()),
                        OutPercentage = decimal.Parse(dr["OutPercentage"].ToString()),
                        Amount        = decimal.Parse(dr["Amount"].ToString()),
                    };
                    items.Add(item);
                }
            }

            return(items);
        }
Example #12
0
        public async Task <IEnumerable <RegularParkerModel> > GetRegularParkersAsync()
        {
            var items = new List <RegularParkerModel>();
            var cmd   = new SqlCommand();

            cmd.CommandText = StoredProcedure;
            var result = await SCObjects.ExecGetDataAsync(cmd, Properties.Settings.Default.UserConnectionString);

            if (result != null)
            {
                foreach (DataRow dr in result.Rows)
                {
                    var item = new RegularParkerModel
                    {
                        Id         = dr["Id"].ToString(),
                        RFID       = dr["RFID"].ToString(),
                        Parker     = dr["Parker"].ToString(),
                        Company    = dr["Company"].ToString(),
                        DateIssued = dr["DateIssued"].ToString(),
                        ValidFrom  = dr["ValidFrom"].ToString(),
                        ValidTo    = dr["ValidTo"].ToString(),
                        Status     = dr["Status"].ToString(),
                    };
                    items.Add(item);
                }
            }

            return(items);
        }
        public async Task <IEnumerable <CashierAccountabilityModel> > CashierAccountabilityAsync(DateTime from, DateTime to, int terminal)
        {
            var        items = new List <CashierAccountabilityModel>();
            SqlCommand cmd   = new SqlCommand();

            cmd.CommandText = StoredProcedure;
            cmd.Parameters.Clear();
            cmd.Parameters.AddWithValue("@DateFrom", from);
            cmd.Parameters.AddWithValue("@DateTo", to);
            cmd.Parameters.AddWithValue("@Terminal", terminal);
            var result = await SCObjects.ExecGetDataAsync(cmd, Properties.Settings.Default.UserConnectionString);

            if (result != null)
            {
                foreach (DataRow dr in result.Rows)
                {
                    var item = new CashierAccountabilityModel
                    {
                        Row           = dr["Row"].ToString(),
                        RunDate       = dr["RunDate"].ToString(),
                        RunTime       = dr["RunTime"].ToString(),
                        Location      = dr["Location"].ToString(),
                        Terminal      = dr["Terminal"].ToString(),
                        TotalAmount   = decimal.Parse(dr["TotalAmount"].ToString()),
                        TotalChange   = decimal.Parse(dr["TotalChange"].ToString()),
                        CarParkIncome = dr["CarParkIncome"].ToString(),
                        ReceiptsOut   = int.Parse(dr["ReceiptsOut"].ToString()),
                        Amount        = decimal.Parse(dr["Amount"].ToString()),
                    };
                    items.Add(item);
                }
            }

            return(items);
        }
Example #14
0
        public async Task <IEnumerable <AuditPerTerminalTicketAccountabilityModel> > AuditPerTerminalTicketAccountabilityAsync(DateTime from, DateTime to, string terminal)
        {
            var        items = new List <AuditPerTerminalTicketAccountabilityModel>();
            SqlCommand cmd   = new SqlCommand();

            cmd.CommandText = AuditPerTerminalTicketAccountability;
            cmd.Parameters.Clear();
            cmd.Parameters.AddWithValue("@DateFrom", from);
            cmd.Parameters.AddWithValue("@DateTo", to);
            cmd.Parameters.AddWithValue("@Terminal", terminal);
            var result = await SCObjects.ExecGetDataAsync(cmd, Properties.Settings.Default.UserConnectionString);

            if (result != null)
            {
                foreach (DataRow dr in result.Rows)
                {
                    var item = new AuditPerTerminalTicketAccountabilityModel
                    {
                        Id          = dr["Id"].ToString(),
                        Description = dr["Description"].ToString(),
                        Value       = dr["Value"].ToString(),
                    };
                    items.Add(item);
                }
            }
            return(items);
        }
Example #15
0
        public async Task <DataTable> WeeklySalesAsync()
        {
            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = "[dbo].[spWeeklySales]";
            cmd.Parameters.Clear();
            var result = await SCObjects.ExecGetDataAsync(cmd, Properties.Settings.Default.UserConnectionString);

            return(result);
        }
        public async Task <DataTable> RemainingCarsDataTableAsync(DateTime date)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = StoredProcedure;
            cmd.Parameters.Clear();
            cmd.Parameters.AddWithValue("@Date", date);
            var result = await SCObjects.ExecGetDataAsync(cmd, Properties.Settings.Default.UserConnectionString);

            return(result);
        }
Example #17
0
        public async Task <DataTable> GetUserAccessMatrixDatatableAsync(string userid)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = StoredProcedure;
            cmd.Parameters.Clear();
            cmd.Parameters.AddWithValue("@UserId", userid);
            var result = await SCObjects.ExecGetDataAsync(cmd, Properties.Settings.Default.UserConnectionString);

            return(result);
        }
Example #18
0
        public async Task <DataTable> GetTransactionImagesHighReso(int id)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = "[dbo].[spLoadTransitImageHighReso]";
            cmd.Parameters.Clear();
            cmd.Parameters.AddWithValue("@Id", id);
            var result = await SCObjects.ExecGetDataAsync(cmd, Properties.Settings.Default.UserConnectionString);

            return(result);
        }
        public async Task <IEnumerable <DetailedTransactionSummaryModel> > DetailedTransactionSummaryAsync(DateTime dateFrom, DateTime dateTo, string keyword, string terminal)
        {
            List <DetailedTransactionSummaryModel> items = new List <DetailedTransactionSummaryModel>();
            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = StoredProcedure;
            cmd.Parameters.Clear();
            cmd.Parameters.AddWithValue("@DateFrom", dateFrom);
            cmd.Parameters.AddWithValue("@DateTo", dateTo);
            cmd.Parameters.AddWithValue("@SearchKey", keyword);
            cmd.Parameters.AddWithValue("@Terminal", terminal);
            var result = await SCObjects.ExecGetDataAsync(cmd, Properties.Settings.Default.UserConnectionString);

            if (result != null)
            {
                foreach (DataRow dr in result.Rows)
                {
                    var item = new DetailedTransactionSummaryModel
                    {
                        TransitId         = int.Parse(dr["TransitId"].ToString()),
                        ORNumber          = dr["ORNumber"].ToString(),
                        Amount            = decimal.Parse(dr["Amount"].ToString()),
                        CardNumber        = dr["CardNumber"].ToString(),
                        Cashier           = dr["Cashier"].ToString(),
                        Duration          = dr["Duration"].ToString(),
                        EntranceDate      = dr["EntranceDate"].ToString(),
                        EntranceTime      = dr["EntranceTime"].ToString(),
                        ExitDate          = dr["ExitDate"].ToString(),
                        ExitTime          = dr["ExitTime"].ToString(),
                        Location          = dr["Location"].ToString(),
                        PlateNo           = dr["PlateNo"].ToString(),
                        RateName          = dr["RateName"].ToString(),
                        TimeIn            = dr["TimeIn"].ToString(),
                        TimeOut           = dr["TimeOut"].ToString(),
                        TotalHours        = dr["TotalHours"].ToString(),
                        Username          = dr["Username"].ToString(),
                        EntranceGate      = dr["EntranceGate"].ToString(),
                        Terminal          = dr["Terminal"].ToString(),
                        EntranceImage     = dr["EntranceImage"].ToString().Length > 0 ? (byte[])(dr["EntranceImage"]) : null,
                        ExitImage         = dr["ExitImage"].ToString().Length > 0 ? (byte[])(dr["ExitImage"]) : null,
                        SCPWDName         = dr["SCPWDName"].ToString(),
                        SCPWDAddress      = dr["SCPWDAddress"].ToString(),
                        SCPWDId           = dr["SCPWDId"].ToString(),
                        LostCardPenalty   = decimal.Parse(dr["LostCardPenalty"].ToString()),
                        LostCardName      = dr["LostCardName"].ToString(),
                        LostCardLicenseNo = dr["LostCardLicenseNo"].ToString(),
                        LostCardORCR      = dr["LostCardORCR"].ToString(),
                        OvernightPenalty  = decimal.Parse(dr["OvernightPenalty"].ToString()),
                    };
                    items.Add(item);
                }
            }
            return(items);
        }
Example #20
0
        public async Task <DataTable> HourlyOccupancyAsync(DateTime date)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = "[dbo].[spDashboardHourlyOccupancy]";
            cmd.Parameters.Clear();
            cmd.Parameters.AddWithValue("@Date", date);
            var result = await SCObjects.ExecGetDataAsync(cmd, Properties.Settings.Default.UserConnectionString);

            return(result);
        }
        public async Task <DataTable> CardClearingDataTableAsync(DateTime from, DateTime to, string terminal)
        {
            var cmd = new SqlCommand();

            cmd.CommandText = StoredProcedure;
            cmd.Parameters.Clear();
            cmd.Parameters.AddWithValue("@DateFrom", from);
            cmd.Parameters.AddWithValue("@DateTo", to);
            cmd.Parameters.AddWithValue("@Terminal", terminal);
            var result = await SCObjects.ExecGetDataAsync(cmd, Properties.Settings.Default.UserConnectionString);

            return(result);
        }
        public async Task <DataTable> SummaryReportPerTerminalProcessedTicketsDataTableAsync(DateTime from, DateTime to, string terminal)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = SummaryReportPerTerminalProcessedTickets;
            cmd.Parameters.Clear();
            cmd.Parameters.AddWithValue("@DateFrom", from);
            cmd.Parameters.AddWithValue("@DateTo", to);
            cmd.Parameters.AddWithValue("@TerminalId", terminal);
            var result = await SCObjects.ExecGetDataAsync(cmd, Properties.Settings.Default.UserConnectionString);

            return(result);
        }
Example #23
0
        public async Task <DataTable> AuditPerTerminalTicketAccountabilityDataTableAsync(DateTime from, DateTime to, string terminal)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = AuditPerTerminalTicketAccountability;
            cmd.Parameters.Clear();
            cmd.Parameters.AddWithValue("@DateFrom", from);
            cmd.Parameters.AddWithValue("@DateTo", to);
            cmd.Parameters.AddWithValue("@Terminal", terminal);
            var result = await SCObjects.ExecGetDataAsync(cmd, Properties.Settings.Default.UserConnectionString);

            return(result);
        }
        public async Task <DataTable> DetailedTransactionSummaryDatatableAsync(DateTime dateFrom, DateTime dateTo, string keyword, string terminal)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = StoredProcedure;
            cmd.Parameters.Clear();
            cmd.Parameters.AddWithValue("@DateFrom", dateFrom);
            cmd.Parameters.AddWithValue("@DateTo", dateTo);
            cmd.Parameters.AddWithValue("@SearchKey", keyword);
            cmd.Parameters.AddWithValue("@Terminal", terminal);
            var result = await SCObjects.ExecGetDataAsync(cmd, Properties.Settings.Default.UserConnectionString);

            return(result);
        }
        public async Task <DataTable> GetHistoryDataTableAsync(DateTime dateFrom, DateTime dateTo, string terminal, string Keyword, bool basedOnExit)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = StoredProcedure;
            cmd.Parameters.Clear();
            cmd.Parameters.AddWithValue("@DateFrom", dateFrom);
            cmd.Parameters.AddWithValue("@DateTo", dateTo);
            cmd.Parameters.AddWithValue("@Terminal", terminal);
            cmd.Parameters.AddWithValue("@SearchKey", Keyword);
            cmd.Parameters.AddWithValue("@QueryType", basedOnExit ? 2 : 1);
            var result = await SCObjects.ExecGetDataAsync(cmd, Properties.Settings.Default.UserConnectionString);

            return(result);
        }
        public async Task <IEnumerable <HistoryModel> > GetHistoryReportAsync(DateTime dateFrom, DateTime dateTo, string terminal, string Keyword, bool basedOnExit)
        {
            var        items = new List <HistoryModel>();
            SqlCommand cmd   = new SqlCommand();

            cmd.CommandText = StoredProcedure;
            cmd.Parameters.Clear();
            cmd.Parameters.AddWithValue("@DateFrom", dateFrom);
            cmd.Parameters.AddWithValue("@DateTo", dateTo);
            cmd.Parameters.AddWithValue("@Terminal", terminal);
            cmd.Parameters.AddWithValue("@SearchKey", Keyword);
            cmd.Parameters.AddWithValue("@QueryType", basedOnExit ? 2 : 1);
            var result = await SCObjects.ExecGetDataAsync(cmd, Properties.Settings.Default.UserConnectionString);

            foreach (DataRow dr in result.Rows)
            {
                var item = new HistoryModel();
                item.Id                = int.Parse(dr["TransitId"].ToString());
                item.Terminal          = dr["Terminal"].ToString();
                item.ORNumber          = dr["ORNumber"].ToString();
                item.Type              = dr["Type"].ToString();
                item.PlateNo           = dr["PlateNo"].ToString();
                item.TicketNumber      = dr["TicketNumber"].ToString();
                item.TimeIn            = dr["TimeIn"].ToString();
                item.TimeOut           = dr["TimeOut"].ToString();
                item.Duration          = dr["Duration"].ToString();
                item.RateName          = dr["RateName"].ToString();
                item.Coupon            = dr["Coupon"].ToString();
                item.MonthlyName       = dr["MonthlyName"].ToString();
                item.MonthlyRFID       = dr["MonthlyRFID"].ToString();
                item.SCPWDName         = dr["SCPWDName"].ToString();
                item.SCPWDAddress      = dr["SCPWDAddress"].ToString();
                item.SCPWDId           = dr["SCPWDId"].ToString();
                item.LostCardPenalty   = decimal.Parse(dr["LostCardPenalty"].ToString());
                item.LostCardName      = dr["LostCardName"].ToString();
                item.LostCardLicenseNo = dr["LostCardLicenseNo"].ToString();
                item.LostCardORCR      = dr["LostCardORCR"].ToString();
                item.OvernightPenalty  = decimal.Parse(dr["OvernightPenalty"].ToString());

                item.EntranceImage = dr["EntranceImage"].ToString().Length > 0 ? (byte[])(dr["EntranceImage"]) : null;
                item.ExitImage     = dr["ExitImage"].ToString().Length > 0 ? (byte[])(dr["ExitImage"]) : null;
                item.EntranceGate  = dr["EntranceGate"].ToString();
                items.Add(item);
            }
            return(items);
        }
Example #27
0
        public async Task <IEnumerable <UserAccessMatrixItemModel> > GetUserAccessMatrixAsync(string userid)
        {
            var items = new List <UserAccessMatrixItemModel>();

            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = StoredProcedure;
            cmd.Parameters.Clear();
            cmd.Parameters.AddWithValue("@UserId", userid);
            var result = await SCObjects.ExecGetDataAsync(cmd, Properties.Settings.Default.UserConnectionString);

            if (result != null)
            {
                foreach (DataRow dr in result.Rows)
                {
                    var item = new UserAccessMatrixItemModel
                    {
                        UserId            = int.Parse(dr["UserId"].ToString()),
                        Username          = dr["Username"].ToString(),
                        FirstName         = dr["FirstName"].ToString(),
                        LastName          = dr["LastName"].ToString(),
                        RoleId            = int.Parse(dr["RoleId"].ToString()),
                        RoleCode          = dr["RoleCode"].ToString(),
                        RoleDescription   = dr["RoleDescription"].ToString(),
                        ModuleId          = int.Parse(dr["ModuleId"].ToString()),
                        ModuleCode        = dr["ModuleCode"].ToString(),
                        ModuleDescription = dr["ModuleDescription"].ToString(),
                        TypeId            = int.Parse(dr["TypeId"].ToString()),
                        Type      = dr["Type"].ToString(),
                        CanAdd    = ValueConverter.ConvertFromBoolean(dr["CanAdd"].ToString()),
                        CanEdit   = ValueConverter.ConvertFromBoolean(dr["CanEdit"].ToString()),
                        CanSave   = ValueConverter.ConvertFromBoolean(dr["CanSave"].ToString()),
                        CanDelete = ValueConverter.ConvertFromBoolean(dr["CanDelete"].ToString()),
                        CanSearch = ValueConverter.ConvertFromBoolean(dr["CanSearch"].ToString()),
                        CanPrint  = ValueConverter.ConvertFromBoolean(dr["CanPrint"].ToString()),
                        CanExport = ValueConverter.ConvertFromBoolean(dr["CanExport"].ToString()),
                        CanAccess = ValueConverter.ConvertFromBoolean(dr["CanAccess"].ToString()),
                    };
                    items.Add(item);
                }
            }
            return(items);
        }
Example #28
0
        public async Task <IEnumerable <BIRModel> > BIRReportAsync(DateTime dateFrom, DateTime dateTo, string terminal)
        {
            List <BIRModel> items = new List <BIRModel>();
            SqlCommand      cmd   = new SqlCommand();

            cmd.CommandText = StoredProcedure;
            cmd.Parameters.Clear();
            cmd.Parameters.AddWithValue("@DateFrom", dateFrom);
            cmd.Parameters.AddWithValue("@DateTo", dateTo);
            cmd.Parameters.AddWithValue("@Terminal", terminal);
            var result = await SCObjects.ExecGetDataAsync(cmd, Properties.Settings.Default.UserConnectionString);

            if (result != null)
            {
                foreach (DataRow dr in result.Rows)
                {
                    var item = new BIRModel
                    {
                        Date           = dr["Date"].ToString(),
                        BeginningOR    = dr["BeginningOR"].ToString(),
                        EndingOR       = dr["EndingOR"].ToString(),
                        BeginningSales = dr["BeginningSales"].ToString(),
                        EndingSales    = dr["EndingSales"].ToString(),
                        TotalSales     = dr["TotalSales"].ToString(),
                        DiscountSC     = dr["DiscountSC"].ToString(),
                        DiscountPWD    = dr["DiscountPWD"].ToString(),
                        DiscountOthers = dr["DiscountOthers"].ToString(),
                        GrossAmount    = dr["GrossAmount"].ToString(),
                        Vatable        = dr["Vatable"].ToString(),
                        Vat            = dr["Vat"].ToString(),
                        VatExempt      = dr["VatExempt"].ToString(),
                        ZeroRated      = dr["ZeroRated"].ToString(),
                        ResetCount     = dr["ResetCount"].ToString(),
                        ZCounter       = dr["ZCounter"].ToString(),
                        Remarks        = dr["Remarks"].ToString(),
                    };
                    items.Add(item);
                }
            }

            return(items);
        }
Example #29
0
        public async Task <IEnumerable <ShiftModel> > ShiftReportAsync(DateTime from, DateTime to, string keyword, string terminal)
        {
            var        items = new List <ShiftModel>();
            SqlCommand cmd   = new SqlCommand();

            cmd.CommandText = StoredProcedure;
            cmd.Parameters.Clear();
            cmd.Parameters.AddWithValue("@DateFrom", from);
            cmd.Parameters.AddWithValue("@DateTo", to);
            cmd.Parameters.AddWithValue("@Keyword", keyword);
            cmd.Parameters.AddWithValue("@Terminal", terminal);
            var result = await SCObjects.ExecGetDataAsync(cmd, Properties.Settings.Default.UserConnectionString);

            if (result != null)
            {
                foreach (DataRow dr in result.Rows)
                {
                    var item = new ShiftModel
                    {
                        SRNumber          = dr["SRNumber"].ToString(),
                        Type              = dr["Type"].ToString(),
                        DateTimeIn        = dr["DateTimeIn"].ToString(),
                        DateTimeOut       = dr["DateTimeOut"].ToString(),
                        ExitCount         = int.Parse(dr["ExitCount"].ToString()),
                        GrossAmount       = dr["GrossAmount"].ToString().Length > 0 ? decimal.Parse(dr["GrossAmount"].ToString()) : 0,
                        Vatable           = dr["Vatable"].ToString().Length > 0 ? decimal.Parse(dr["Vatable"].ToString()) : 0,
                        Vat               = dr["Vat"].ToString().Length > 0 ? decimal.Parse(dr["Vat"].ToString()) : 0,
                        Discount          = dr["Discount"].ToString().Length > 0 ? decimal.Parse(dr["Discount"].ToString()) : 0,
                        AmountTendered    = dr["AmountTendered"].ToString().Length > 0 ? decimal.Parse(dr["AmountTendered"].ToString()) : 0,
                        Change            = dr["Change"].ToString().Length > 0 ? decimal.Parse(dr["Change"].ToString()) : 0,
                        ChangeFund        = dr["ChangeFund"].ToString().Length > 0 ? decimal.Parse(dr["ChangeFund"].ToString()) : 0,
                        TenderDeclaration = dr["TenderDeclaration"].ToString().Length > 0 ? decimal.Parse(dr["TenderDeclaration"].ToString()) : 0,
                        SubTotal          = dr["SubTotal"].ToString().Length > 0 ? decimal.Parse(dr["SubTotal"].ToString()) : 0,
                        Variance          = dr["Variance"].ToString().Length > 0 ? decimal.Parse(dr["Variance"].ToString()) : 0,
                        Cashier           = dr["Cashier"].ToString(),
                        Exit              = dr["Exit"].ToString(),
                    };
                    items.Add(item);
                }
            }
            return(items);
        }
        public async Task <IEnumerable <CashlessModel> > CashlessReportAsync(DateTime datefrom, DateTime dateto, string keyword, string terminal)
        {
            List <CashlessModel> items = new List <CashlessModel>();

            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = StoredProcedure;
            cmd.Parameters.Clear();
            cmd.Parameters.AddWithValue("@DateFrom", datefrom);
            cmd.Parameters.AddWithValue("@DateTo", dateto);
            cmd.Parameters.AddWithValue("@SearchKey", keyword);
            cmd.Parameters.AddWithValue("@Terminal", terminal);
            var result = await SCObjects.ExecGetDataAsync(cmd, Properties.Settings.Default.UserConnectionString);

            if (result != null)
            {
                foreach (DataRow dr in result.Rows)
                {
                    var item = new CashlessModel
                    {
                        TransitId             = int.Parse(dr["TransitId"].ToString()),
                        ORNo                  = dr["ORNumber"].ToString(),
                        PaymentType           = dr["PaymentType"].ToString(),
                        PlateNo               = dr["PlateNo"].ToString(),
                        TicketNo              = dr["TicketNumber"].ToString(),
                        TimeIn                = dr["TimeIn"].ToString(),
                        TimeOut               = dr["TimeOut"].ToString(),
                        Duration              = dr["Duration"].ToString(),
                        RateName              = dr["RateName"].ToString(),
                        Coupon                = dr["Coupon"].ToString(),
                        GrossAmount           = dr["GrossAmount"].ToString().Length > 0 ? decimal.Parse(dr["GrossAmount"].ToString()) : 0,
                        Discount              = dr["Discount"].ToString().Length > 0 ? decimal.Parse(dr["Discount"].ToString()) : 0,
                        AmountDue             = dr["AmountDue"].ToString().Length > 0 ? decimal.Parse(dr["AmountDue"].ToString()) : 0,
                        AmountTendered        = dr["AmountTendered"].ToString().Length > 0 ? decimal.Parse(dr["AmountTendered"].ToString()) : 0,
                        Change                = dr["Change"].ToString().Length > 0 ? decimal.Parse(dr["Change"].ToString()) : 0,
                        Vatable               = dr["Vatable"].ToString().Length > 0 ? decimal.Parse(dr["Vatable"].ToString()) : 0,
                        Vat                   = dr["Vat"].ToString().Length > 0 ? decimal.Parse(dr["Vat"].ToString()) : 0,
                        VatExempt             = dr["VatExempt"].ToString().Length > 0 ? decimal.Parse(dr["VatExempt"].ToString()) : 0,
                        ZeroRated             = dr["ZeroRated"].ToString().Length > 0 ? decimal.Parse(dr["ZeroRated"].ToString()) : 0,
                        Reprint               = int.Parse(dr["Reprint"].ToString()),
                        Description           = string.Empty,
                        UpdateUser            = dr["UpdateUser"].ToString(),
                        Username              = dr["Username"].ToString(),
                        Entrance              = dr["Entrance"].ToString(),
                        Exit                  = dr["Exit"].ToString(),
                        IsErased              = dr["IsErased"].ToString().Equals("1") ? true : false,
                        SCPWDName             = dr["SCPWDName"].ToString(),
                        SCPWDAddress          = dr["SCPWDAddress"].ToString(),
                        SCPWDId               = dr["SCPWDId"].ToString(),
                        LostCardPenalty       = decimal.Parse(dr["LostCardPenalty"].ToString()),
                        LostCardName          = dr["LostCardName"].ToString(),
                        LostCardLicenseNo     = dr["LostCardLicenseNo"].ToString(),
                        LostCardORCR          = dr["LostCardORCR"].ToString(),
                        OvernightPenalty      = decimal.Parse(dr["OvernightPenalty"].ToString()),
                        CashlessType          = dr["CashlessType"].ToString(),
                        CashlessTransactionNo = dr["CashlessReferenceNo"].ToString(),
                    };

                    items.Add(item);
                }
            }

            return(items);
        }