Esempio n. 1
0
        public member findmemberById(string Id)
        {
            member        pro    = null;
            string        quary  = "exec searchmemberbyId '" + Id + "'";
            SqlDataReader reader = new SystemDAL().executeQueryS(quary);

            if (reader.Read())
            {
                pro = new member(
                    reader[0].ToString(), reader[1].ToString(), reader[2].ToString(), reader[3].ToString(), Convert.ToInt32(reader[4].ToString()), reader[5].ToString(), reader[6].ToString(), reader[7].ToString());
            }
            reader.Close();
            return(pro);
        }
Esempio n. 2
0
        public User login(string username, string password)
        {
            User          usr    = null;
            string        quary  = "exec users '" + username + "','" + password + "'";
            SqlDataReader reader = new SystemDAL().executeQueryS(quary);

            if (reader.Read())
            {
                usr = new User(
                    reader[0].ToString(), reader[1].ToString());
            }
            reader.Close();
            return(usr);
        }
Esempio n. 3
0
        public Trainer findTrainerById(string Id)
        {
            Trainer       pro    = null;
            string        quary  = "exec searchtrainerbyId '" + Id + "'";
            SqlDataReader reader = new SystemDAL().executeQueryS(quary);

            if (reader.Read())
            {
                pro = new Trainer(
                    reader[0].ToString(), reader[1].ToString(), reader[2].ToString(), reader[3].ToString(), reader[4].ToString(), reader[5].ToString());
            }
            reader.Close();
            return(pro);
        }
Esempio n. 4
0
        public Equipment findAEquipmentById(string Id)
        {
            Equipment     pro    = null;
            string        quary  = "exec searchEquipmentbyId '" + Id + "'";
            SqlDataReader reader = new SystemDAL().executeQueryS(quary);

            if (reader.Read())
            {
                pro = new Equipment(
                    reader[0].ToString(), reader[1].ToString(),
                    Convert.ToDouble(reader[2].ToString()));
            }
            reader.Close();
            return(pro);
        }
        public Paymentbalance findAPaymentbalanceById(string Id)
        {
            Paymentbalance pro    = null;
            string         quary  = "exec searchpaybalancebyID '" + Id + "'";
            SqlDataReader  reader = new SystemDAL().executeQueryS(quary);

            if (reader.Read())
            {
                pro = new Paymentbalance(
                    reader[0].ToString(), reader[1].ToString(), reader[2].ToString(), reader[3].ToString(), reader[4].ToString(),
                    Convert.ToDouble(reader[5].ToString()), Convert.ToDouble(reader[6].ToString()), Convert.ToDouble(reader[7].ToString()));
            }
            reader.Close();
            return(pro);
        }
Esempio n. 6
0
        public List <ViewAnnual> getAllannualdetails()
        {
            List <ViewAnnual> Annual = new List <ViewAnnual>();
            string            quary  = "exec searchAllAnnual";
            SqlDataReader     reader = new SystemDAL().executeQueryS(quary);

            //for many records go with while loop
            while (reader.Read())
            {
                Annual.Add(new ViewAnnual(
                               reader[0].ToString(), reader[1].ToString(), Convert.ToInt32(reader[2]), reader[3].ToString(), reader[4].ToString()));
            }
            reader.Close();
            return(Annual);
        }
Esempio n. 7
0
        public List <member> getAllmemberdetails()
        {
            List <member> Memebers = new List <member>();
            string        quary    = "exec searchAllMemberDetails";
            SqlDataReader reader   = new SystemDAL().executeQueryS(quary);

            // for many records go with while loop
            while (reader.Read())
            {
                Memebers.Add(new member(
                                 reader[0].ToString(), reader[1].ToString(), reader[2].ToString(), reader[3].ToString(), Convert.ToInt32(reader[4].ToString()), reader[5].ToString(), reader[6].ToString(), reader[7].ToString()));
            }
            reader.Close();
            return(Memebers);
        }
Esempio n. 8
0
        public List <Order> addToList(string id)
        {
            List <Order> odr = new List <Order>();

            string        quary  = "exec AddProductTb'" + id + "'";
            SqlDataReader reader = new SystemDAL().executeQueryS(quary);

            while (reader.Read())
            {
                odr.Add(new Order(
                            reader[0].ToString(), reader[1].ToString(), Convert.ToDouble(reader[2].ToString())));
            }
            reader.Close();
            return(odr);
        }
        public List <Viewsix_month> getAllsix_monthdetails()
        {
            List <Viewsix_month> viewsixmonth = new List <Viewsix_month>();
            string        quary  = "exec searchAllsixmonth";
            SqlDataReader reader = new SystemDAL().executeQueryS(quary);

            //for many records go with while loop
            while (reader.Read())
            {
                viewsixmonth.Add(new Viewsix_month(
                                     reader[0].ToString(), reader[1].ToString(), Convert.ToInt32(reader[2]), reader[3].ToString(), reader[4].ToString()));
            }
            reader.Close();
            return(viewsixmonth);
        }
        public List <Paymentbalance> getAllPaymentsbalance()
        {
            List <Paymentbalance> paymentbalance = new List <Paymentbalance>();
            string        quary  = "exec searchAllpaymentbalance";
            SqlDataReader reader = new SystemDAL().executeQueryS(quary);

            // for many records go with while loop
            while (reader.Read())
            {
                paymentbalance.Add(new Paymentbalance(
                                       reader[0].ToString(), reader[1].ToString(), reader[2].ToString(), reader[3].ToString(), reader[4].ToString(),
                                       Convert.ToDouble(reader[5].ToString()), Convert.ToDouble(reader[6].ToString()), Convert.ToDouble(reader[7].ToString())));
            }
            reader.Close();
            return(paymentbalance);
        }
        public List <MemPayments> getAllPayments()
        {
            List <MemPayments> Payment = new List <MemPayments>();
            string             quary   = "exec searchAllPayments";
            SqlDataReader      reader  = new SystemDAL().executeQueryS(quary);

            // for many records go with while loop
            while (reader.Read())
            {
                Payment.Add(new MemPayments(
                                reader[0].ToString(), reader[1].ToString(), reader[2].ToString(), reader[3].ToString(),
                                Convert.ToDouble(reader[4].ToString()), reader[5].ToString(), reader[6].ToString()));
            }
            reader.Close();
            return(Payment);
        }
        public MemPayments getAllPaymentsId(string Id)
        {
            MemPayments   pro    = null;
            string        quary  = "exec searchpaymentbyId '" + Id + "'";
            SqlDataReader reader = new SystemDAL().executeQueryS(quary);

            // for many records go with while loop
            if (reader.Read())
            {
                pro = new MemPayments(
                    reader[0].ToString(), reader[1].ToString(), reader[2].ToString(), reader[3].ToString(),
                    Convert.ToDouble(reader[4].ToString()), reader[5].ToString(), reader[6].ToString());
            }
            reader.Close();
            return(pro);
        }
Esempio n. 13
0
        public List <Attendance> getAllattendancedetails()
        {
            List <Attendance> attendance = new List <Attendance>();
            string            quary      = "exec searchAllAattendance";
            SqlDataReader     reader     = new SystemDAL().executeQueryS(quary);

            // for many records go with while loop
            while (reader.Read())
            {
                attendance.Add(new Attendance(
                                   reader[0].ToString(), reader[1].ToString(), reader[2].ToString(), reader[3].ToString(),
                                   reader[4].ToString(), reader[5].ToString(), reader[6].ToString()));
            }
            reader.Close();
            return(attendance);
        }
Esempio n. 14
0
        public List <User> getAllusers()
        {
            List <User> usera = new List <User>();

            string        quary  = "exec searchAllusers";
            SqlDataReader reader = new SystemDAL().executeQueryS(quary);

            while (reader.Read())
            {
                usera.Add(new User(

                              reader[0].ToString(), reader[1].ToString(), reader[2].ToString(), reader[3].ToString(), reader[4].ToString()));
            }
            reader.Close();
            return(usera);
        }
        public schedule findscheduleById(string Id)
        {
            // TODO: Get Search schedule details by Id

            schedule      pro    = null;
            string        quary  = "exec searchschedulebyId '" + Id + "'";
            SqlDataReader reader = new SystemDAL().executeQueryS(quary);

            if (reader.Read())
            {
                pro = new schedule(
                    reader[0].ToString(), reader[1].ToString(), reader[2].ToString(), reader[3].ToString(), reader[4].ToString(), reader[5].ToString(), reader[6].ToString());
            }
            reader.Close();
            return(pro);
        }
Esempio n. 16
0
        public List <Equipment> getAllEquipment()
        {
            List <Equipment> Equipment = new List <Equipment>();
            string           quary     = "exec searchAllEquipment";
            SqlDataReader    reader    = new SystemDAL().executeQueryS(quary);

            // for many records go with while loop
            while (reader.Read())
            {
                Equipment.Add(new Equipment(
                                  reader[0].ToString(), reader[1].ToString(),
                                  Convert.ToDouble(reader[2].ToString())));
            }
            reader.Close();
            return(Equipment);
        }
Esempio n. 17
0
        public List <Order> getAllProducts()
        {
            List <Order> Order = new List <Order>();

            string        quary  = "exec searchAllOrders";
            SqlDataReader reader = new SystemDAL().executeQueryS(quary);

            while (reader.Read())
            {
                Order.Add(new Order(

                              reader[0].ToString(), reader[1].ToString(),
                              Convert.ToDouble(reader[2].ToString())));
            }
            reader.Close();
            return(Order);
        }
        public List <schedule> getAllScheduledetails()
        {
            // TODO: Get All Schedule details
            List <schedule> schedules = new List <schedule>();
            string          quary     = "exec searchAllSchedule";
            SqlDataReader   reader    = new SystemDAL().executeQueryS(quary);

            // for many records go with while loop
            while (reader.Read())
            {
                schedules.Add(new schedule(
                                  reader[0].ToString(), reader[1].ToString(), reader[2].ToString(), reader[3].ToString(),
                                  reader[4].ToString(), reader[5].ToString(), reader[6].ToString()));
            }
            reader.Close();
            return(schedules);
        }
Esempio n. 19
0
        public double addToOrder(LineProduct line, string oid)
        {
            double amount = 0.0;
            String quary  = "insert into LineProductTb values('" + oid + "','" + line._product.EquipID + "'," + line._Quantity + "," + line._total + ")";
            bool   result = new SystemDAL().executeNonQueryS(quary);

            if (result)
            {
                string        getTotalAmount = "select sum(Total) from LineProductTb where orderId='" + oid + "'";
                SqlDataReader reader         = new SystemDAL().executeQueryS(getTotalAmount);
                if (reader.Read())
                {
                    amount = Convert.ToDouble(reader[0]);
                }
                reader.Close();
            }
            return(amount);
        }
Esempio n. 20
0
        public List <SalesReport> salesRpt()
        {
            List <SalesReport> pro    = new List <SalesReport>();
            string             query  = "GetSalesReportDay '" + Date + "'";
            SqlDataReader      reader = new SystemDAL().executeQuerys(query);

            while (reader.Read())
            {
                try
                {
                    pro.Add(new SalesReport(Convert.ToInt32(reader[0]), reader[1].ToString(), Convert.ToInt32(reader[2]), Convert.ToInt32(reader[3]), Convert.ToDecimal(reader[4])));
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex);
                }
            }
            reader.Close();

            return(pro);
        }
Esempio n. 21
0
        public List <Drug_Report> DrugInvRpt()
        {
            List <Drug_Report> pro    = new List <Drug_Report>();
            string             query  = "drugInventryReportData";
            SqlDataReader      reader = new SystemDAL().executeQuerys(query);

            while (reader.Read())
            {
                try
                {
                    pro.Add(new Drug_Report(Convert.ToInt32(reader[0]), reader[1].ToString(), Convert.ToDecimal(reader[2]), reader[3].ToString(), Convert.ToInt32(reader[4]), reader[5].ToString(), reader[6].ToString(), Convert.ToInt32(reader[7])));
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex);
                }
            }
            reader.Close();

            return(pro);
        }
Esempio n. 22
0
        public List <Purchase_Report> purchaseRptChart()
        {
            List <Purchase_Report> pro = new List <Purchase_Report>();
            string        query        = "GetPurchaseReportChart '" + Date + "','" + Date2 + "'";
            SqlDataReader reader       = new SystemDAL().executeQuerys(query);

            while (reader.Read())
            {
                try
                {
                    pro.Add(new Purchase_Report(Convert.ToDateTime(reader[0]).ToShortDateString() + " " + reader[2].ToString(), Convert.ToInt32(reader[1])));
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex);
                }
            }
            reader.Close();

            return(pro);
        }
Esempio n. 23
0
        public List <Drug_Report> DrugPurchasedMontlyAll()
        {
            List <Drug_Report> pro    = new List <Drug_Report>();
            string             query  = "DrugqtyPurchasedForTheMonthAll";
            SqlDataReader      reader = new SystemDAL().executeQuerys(query);

            while (reader.Read())
            {
                try
                {
                    string month = System.Globalization.CultureInfo.
                                   CurrentCulture.DateTimeFormat.GetMonthName(Convert.ToInt32(reader[1]));
                    pro.Add(new Drug_Report(reader[0].ToString(), month, reader[2].ToString(), reader[3].ToString(), Convert.ToInt32(reader[4])));
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex);
                }
            }
            reader.Close();

            return(pro);
        }
Esempio n. 24
0
        public List <SalesReport> salesRptMonthlyRpt()
        {
            List <SalesReport> pro    = new List <SalesReport>();
            string             query  = "monthlySales";
            SqlDataReader      reader = new SystemDAL().executeQuerys(query);

            while (reader.Read())
            {
                try
                {
                    string month = System.Globalization.CultureInfo.
                                   CurrentCulture.DateTimeFormat.GetMonthName(Convert.ToInt32(reader[1]));

                    pro.Add(new SalesReport(reader[0].ToString(), month, Convert.ToDecimal(reader[2])));
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex);
                }
            }
            reader.Close();

            return(pro);
        }