Ejemplo n.º 1
0
        public long GetPaymentHistory(out List <Admin> lst, long CompanyID)
        {
            long returnCode = -1;

            lst = new List <Admin>();
            try
            {
                DataSet ds = new DataSet();
                List <MySqlParameter> parameters = new List <MySqlParameter>
                {
                    new MySqlParameter("CompnID", CompanyID)
                };

                ds = sqlHelper.executeSP <DataSet>(parameters, "SP_GetSubPaymentHistory");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    DTtoListConverter.ConvertTo(ds.Tables[0], out lst);
                    returnCode = 1;
                }
                return(returnCode);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            // return returnCode;
        }
Ejemplo n.º 2
0
        public long GetOrderDetails(long CompId, int flag, out List <Billing> lstOrderedDetails)
        {
            long returnCode = -1;

            lstOrderedDetails = new List <Billing>();
            try
            {
                DataSet ds = new DataSet();
                List <MySqlParameter> parameters = new List <MySqlParameter>
                {
                    new MySqlParameter("CompnID", CompId),
                };
                if (flag.Equals(1))
                {
                    ds = sqlHelper.executeSP <DataSet>(parameters, "SP_GetOrderDetails");
                }
                else if (flag.Equals(2))
                {
                    ds = sqlHelper.executeSP <DataSet>(parameters, "SP_GetBillingDetails");
                }

                if (ds.Tables[0].Rows.Count > 0)
                {
                    DTtoListConverter.ConvertTo(ds.Tables[0], out lstOrderedDetails);
                    return(returnCode = 1);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(returnCode);
        }
Ejemplo n.º 3
0
        public long GetFoodProductAdmin(long CompId, out List <FoodProducts> lstProducts)
        {
            long returnCode = -1;

            lstProducts = new List <FoodProducts>();
            try
            {
                DataSet ds = new DataSet();
                List <MySqlParameter> parameters = new List <MySqlParameter>
                {
                    new MySqlParameter("CompnID", CompId)
                };

                ds = sqlHelper.executeSP <DataSet>(parameters, "SP_GetFoodProducts");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    DTtoListConverter.ConvertTo(ds.Tables[0], out lstProducts);
                    returnCode = 1;
                }
                return(returnCode);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            // return returnCode;
        }
Ejemplo n.º 4
0
        public List <Admin> GetSubscriptionSA(string SAUserName, int flag)
        {
            if (SAUserName == null)
            {
                SAUserName = "";
            }
            List <Admin> lst = new List <Admin>();
            DataSet      ds  = new DataSet();

            try
            {
                List <MySqlParameter> parameters = new List <MySqlParameter>
                {
                    new MySqlParameter("SAUserName", SAUserName),
                    new MySqlParameter("Flag", flag),
                };

                ds = sqlHelper.executeSP <DataSet>(parameters, "SP_GetSubscriptionSA");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    DTtoListConverter.ConvertTo(ds.Tables[0], out lst);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(lst);
        }
Ejemplo n.º 5
0
        public List <Admin> IsUserExists(LoginSignUp obj)
        {
            List <Admin> lst = new List <Admin>();

            try
            {
                List <MySqlParameter> parameters = new List <MySqlParameter>
                {
                    new MySqlParameter("UserN", obj.UserName),
                    new MySqlParameter("Pswd", obj.Password),
                };

                DataSet ds = sqlHelper.executeSP <DataSet>(parameters, "SP_IsUserExits");
                if (ds.Tables.Count > 0)
                {
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        DTtoListConverter.ConvertTo(ds.Tables[0], out lst);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(lst);
        }
Ejemplo n.º 6
0
        public List <Admin> RegisterAdmin(Admin item)
        {
            List <Admin> lst = new List <Admin>();
            DataSet      ds  = new DataSet();

            try
            {
                //int Tdays = Convert.ToInt32(item.EndDate - item.StartDate);
                TimeSpan difference = item.EndDate - item.StartDate;
                var      Tdays      = difference.TotalDays;
                string   Status     = string.Empty;
                if (item.Pause.Equals("false"))
                {
                    Status = "InActive";
                }
                else
                {
                    Status = "Active";
                }
                List <MySqlParameter> parameters = new List <MySqlParameter>
                {
                    new MySqlParameter("Addre", item.Address),
                    new MySqlParameter("Commnt", item.Comments),
                    new MySqlParameter("CompName", item.CompanyName),
                    new MySqlParameter("CPDay", item.CostPerDay),
                    new MySqlParameter("CName", item.CustomerName),

                    new MySqlParameter("CompStatus", Status),
                    new MySqlParameter("PhNo", item.PhoneNumber),
                    new MySqlParameter("Pswd", item.Password),
                    new MySqlParameter("Uname", item.UserName),
                    new MySqlParameter("AccRegDate", DateTime.Now),

                    new MySqlParameter("Amt", item.TotalAmount),
                    new MySqlParameter("TotDays", Tdays),
                    new MySqlParameter("PStatus", item.DrCr),
                    new MySqlParameter("Edate", item.EndDate),
                    new MySqlParameter("Sdate", item.StartDate),

                    new MySqlParameter("Pausee", item.Pause),
                    new MySqlParameter("PType", item.Payments),
                    new MySqlParameter("CompId", item.CompanyID),
                };

                ds = sqlHelper.executeSP <DataSet>(parameters, "SP_InsertAdmin");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    DTtoListConverter.ConvertTo(ds.Tables[0], out lst);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(lst);
        }
Ejemplo n.º 7
0
        public List <Billing> SavePlaceOrder(List <Billing> lstCustOrders, string OrderId)
        {
            List <Billing> lst = new List <Billing>();

            try
            {
                DataSet ds = new DataSet();
                foreach (var item in lstCustOrders)
                {
                    List <MySqlParameter> parameters = new List <MySqlParameter>
                    {
                        new MySqlParameter("FoodProdid", item.FoodProductId),
                        new MySqlParameter("CompID", item.CompanyID),
                        new MySqlParameter("CustID", item.CustomerId),
                        new MySqlParameter("CustName", item.CustomerName),
                        new MySqlParameter("PhoneNo", item.PhoneNumber),

                        new MySqlParameter("TotalAmt", item.TotalAmount),
                        new MySqlParameter("Qty", item.Quantity),
                        new MySqlParameter("TaxPer", item.Tax),
                        new MySqlParameter("TableId", item.TableNo),
                        new MySqlParameter("PaymentType", item.PaymentType),
                        new MySqlParameter("OrderId", OrderId),
                        new MySqlParameter("Addr", item.Address),
                        new MySqlParameter("Cmnt", item.Comments ?? "No comments entered"),
                    };

                    ds = sqlHelper.executeSP <DataSet>(parameters, "SP_InsertPlaceOrder");

                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        DTtoListConverter.ConvertTo(ds.Tables[0], out lst);
                    }
                    else
                    {
                        return(lst);
                    }
                }
                return(lst);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            // return returnCode;
        }
Ejemplo n.º 8
0
        public List <FoodProducts> InsertFoodProducts(List <FoodProducts> lstFP)
        {
            List <FoodProducts> lstFoodProducts = new List <FoodProducts>();

            long CompId = lstFP[0].CompanyID;

            if (CompId > 0)
            {
                List <MySqlParameter> param = new List <MySqlParameter>
                {
                    new MySqlParameter("CompID", CompId),
                };
                var deletePut = sqlHelper.executeSP <DataSet>(param, "SP_DeleteFoodProducts");
                try
                {
                    foreach (var item in lstFP)
                    {
                        List <MySqlParameter> parameters = new List <MySqlParameter>
                        {
                            new MySqlParameter("CompID", item.CompanyID),
                            new MySqlParameter("PriceAmt", item.Price),
                            new MySqlParameter("Foodnam", item.FoodName),
                            new MySqlParameter("CatgryName", item.CategoryName),
                            new MySqlParameter("Descr", item.Description),
                            new MySqlParameter("ImageSou", item.ImageSource),
                            new MySqlParameter("ImgSourceType", item.Type),
                        };

                        DataSet output = sqlHelper.executeSP <DataSet>(parameters, "SP_InsertFoodProducts");
                        if (output.Tables[0].Rows.Count > 0)
                        {
                            DTtoListConverter.ConvertTo(output.Tables[0], out lstFoodProducts);
                        }
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }

            return(lstFoodProducts);
        }
Ejemplo n.º 9
0
        public List <CustRegister> InsertCust(CustRegister objInsertCust)
        {
            List <CustRegister> lst = new List <CustRegister>();

            try
            {
                List <MySqlParameter> parameters = new List <MySqlParameter>
                {
                    new MySqlParameter("CompID", objInsertCust.CompanyID),
                    new MySqlParameter("OTP", objInsertCust.OTP),
                    new MySqlParameter("SerialNo", objInsertCust.SerialNo),
                    new MySqlParameter("Name", objInsertCust.Name),
                    new MySqlParameter("PhoneNumber", objInsertCust.PhoneNumber),
                    new MySqlParameter("Address", objInsertCust.Address),
                    new MySqlParameter("DOB", objInsertCust.DOB),
                };

                DataSet output = sqlHelper.executeSP <DataSet>(parameters, "SP_InsertCustomer");
                if (output.Tables[0].Rows.Count > 0)
                {
                    //lst = (from DataRow dr in output.Tables[0].Rows
                    //       select new CustRegister()
                    //       {

                    //           CompanyID = (long)dr["CompanyId"],
                    //           CustomerId = (long)dr["CustomerId"],
                    //           OTP = (long)dr["OTP"],
                    //           PhoneNumber = dr["PhoneNumber"].ToString(),
                    //           SerialNo = dr["SerialNo"].ToString(),
                    //           Name = dr["Name"].ToString(),
                    //           Tax = (int)dr["Tax"],
                    //       }).ToList();
                    DTtoListConverter.ConvertTo(output.Tables[0], out lst);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(lst);
        }
Ejemplo n.º 10
0
        public List <FoodProducts> UploadBanner(List <FoodProducts> lstFP)
        {
            List <FoodProducts> lstFoodProducts = new List <FoodProducts>();

            long CompId = lstFP[0].CompanyID;
            List <MySqlParameter> paramss = new List <MySqlParameter>
            {
                new MySqlParameter("CompID", CompId),
            };
            var deletePut = sqlHelper.executeSP <DataSet>(paramss, "SP_DeleteBanners");

            if (CompId > 0)
            {
                try
                {
                    foreach (var item in lstFP)
                    {
                        List <MySqlParameter> parameters = new List <MySqlParameter>
                        {
                            new MySqlParameter("CompID", item.CompanyID),
                            new MySqlParameter("ImageSou", item.ImageSource),
                        };

                        DataSet output = sqlHelper.executeSP <DataSet>(parameters, "SP_UploadBanner");
                        if (output.Tables[0].Rows.Count > 0)
                        {
                            DTtoListConverter.ConvertTo(output.Tables[0], out lstFoodProducts);
                        }
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }

            return(lstFoodProducts);
        }
Ejemplo n.º 11
0
        public List <FoodProducts> GetBanners(long CompanyId)
        {
            List <FoodProducts> lst = new List <FoodProducts>();

            try
            {
                List <MySqlParameter> parameters = new List <MySqlParameter>
                {
                    new MySqlParameter("CompID", CompanyId),
                };

                DataSet output = sqlHelper.executeSP <DataSet>(parameters, "SP_GetBanner");
                if (output.Tables[0].Rows.Count > 0)
                {
                    DTtoListConverter.ConvertTo(output.Tables[0], out lst);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(lst);
        }