Пример #1
0
        }//END OF SEARCH SPECIFIC PENDING ACCOUNT

        public List <JoinAccountInfo> searchReceiptRefence_transactions(string dtFrom, string dtTo)
        {
            DateTime dfrom = DateTime.Parse(dtFrom);

            dtFrom = dfrom.ToString("yyyy-MM-dd");

            DateTime dto = DateTime.Parse(dtTo);

            dtTo = dto.ToString("yyyy-MM-dd");

            try
            {
                openConnection();
                sql = @"SELECT * FROM (((tblreceiptreference A INNER JOIN tblvehicleinfo B ON A.refVehicleID = B.vehicleID) 
                                    INNER JOIN tblparkingslot C ON A.refParkingID = C.slotID) 
                                    INNER JOIN tblvehiclebrand D ON D.brandID = B.vehicleBrand)
                                    INNER JOIN tblvehicletype E ON E.typeID = D.brandCategory WHERE A.refStatus='PAID' AND (A.created_at BETWEEN '" + dtFrom + "' AND '" + dtTo + "') ORDER BY A.refID";


                cmd = new MySqlCommand(sql, con);
                rd  = cmd.ExecuteReader();

                if (rd.HasRows)
                {
                    var listOfReceipt = new List <JoinAccountInfo>();

                    while (rd.Read())
                    {
                        var receipt = new JoinAccountInfo();

                        receipt.refID           = rd["refID"].ToString();
                        receipt.refBarcode      = rd["refBarcode"].ToString();
                        receipt.refVehicleID    = rd["refVehicleID"].ToString();
                        receipt.refParkingID    = rd["refParkingID"].ToString();
                        receipt.refTimeIn       = rd["refTimeIn"].ToString();
                        receipt.refTimeOut      = rd["refTimeOut"].ToString();
                        receipt.refPersonnelIn  = rd["refPersonnelIn"].ToString();
                        receipt.refPersonnelOut = rd["refPersonnelOut"].ToString();
                        receipt.refStatus       = rd["refStatus"].ToString();
                        receipt.refTimeCount    = rd["refTimeCount"].ToString();
                        receipt.refPrice        = rd["refPrice"].ToString();
                        receipt.refAmountChange = rd["refAmountChange"].ToString();
                        receipt.refAmountPaid   = rd["refAmountPaid"].ToString();

                        receipt.vehicleOwner    = rd["vehicleOwner"].ToString();
                        receipt.slotBlock       = rd["slotBlock"].ToString();
                        receipt.slotNumber      = rd["slotNumber"].ToString();
                        receipt.typeRatePerHour = rd["typeRatePerHour"].ToString();
                        receipt.vehicleColor    = rd["vehicleColor"].ToString();
                        receipt.vehiclePlateNo  = rd["vehiclePlateNo"].ToString();
                        receipt.typeName        = rd["typeName"].ToString();
                        receipt.brandName       = rd["brandName"].ToString();

                        listOfReceipt.Add(receipt);
                    }

                    return(listOfReceipt);
                }
                else
                {
                    Console.WriteLine("No data");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
            finally
            {
                con.Close();
            }

            return(null);
        }//END OF SEARCH TRANSACTIONS PER DATE
Пример #2
0
        }//END OF SEARCH FROM ALL PENDING ACCOUNT

        public List <JoinAccountInfo> searchReceiptRefence_pending_specific(string searchText)
        {
            try
            {
                openConnection();
                sql = @"SELECT * FROM (((tblreceiptreference A INNER JOIN tblvehicleinfo B ON A.refVehicleID = B.vehicleID) 
                                    INNER JOIN tblparkingslot C ON A.refParkingID = C.slotID) 
                                    INNER JOIN tblvehiclebrand D ON D.brandID = B.vehicleBrand)
                                    INNER JOIN tblvehicletype E ON E.typeID = D.brandCategory WHERE A.refBarcode='" + searchText + "' AND refStatus='PENDING'";


                cmd = new MySqlCommand(sql, con);
                rd  = cmd.ExecuteReader();

                if (rd.HasRows)
                {
                    var listOfReceipt = new List <JoinAccountInfo>();

                    while (rd.Read())
                    {
                        var receipt = new JoinAccountInfo();

                        receipt.refID        = rd["refID"].ToString();
                        receipt.refBarcode   = rd["refBarcode"].ToString();
                        receipt.refVehicleID = rd["refVehicleID"].ToString();
                        receipt.refParkingID = rd["refParkingID"].ToString();
                        receipt.refTimeIn    = rd["refTimeIn"].ToString();
                        //receipt.refTimeOut = rd["refTimeOut"].ToString();
                        receipt.refPersonnelIn  = rd["refPersonnelIn"].ToString();
                        receipt.refPersonnelOut = rd["refPersonnelOut"].ToString();
                        receipt.refStatus       = rd["refStatus"].ToString();
                        receipt.refTimeCount    = rd["refTimeCount"].ToString();
                        receipt.refPrice        = rd["refPrice"].ToString();
                        receipt.refAmountChange = rd["refAmountChange"].ToString();
                        receipt.refAmountPaid   = rd["refAmountPaid"].ToString();

                        receipt.vehicleOwner    = rd["vehicleOwner"].ToString();
                        receipt.slotBlock       = rd["slotBlock"].ToString();
                        receipt.slotNumber      = rd["slotNumber"].ToString();
                        receipt.typeRatePerHour = rd["typeRatePerHour"].ToString();
                        receipt.vehicleColor    = rd["vehicleColor"].ToString();
                        receipt.vehiclePlateNo  = rd["vehiclePlateNo"].ToString();
                        receipt.typeName        = rd["typeName"].ToString();
                        receipt.brandName       = rd["brandName"].ToString();

                        listOfReceipt.Add(receipt);
                    }

                    return(listOfReceipt);
                }
                else
                {
                    Console.WriteLine("No data");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
            finally
            {
                con.Close();
            }

            return(null);
        }//END OF SEARCH SPECIFIC PENDING ACCOUNT