示例#1
0
        public DataSet FetchAllProducts()
        {
            string Source = "sp_fetchProducts";

            try
            {
                Object[] param = null;
                return(MySQLCommands.Instance().ExecuteQuery(Source, CommandType.StoredProcedure, param));
            }
            catch (Exception ex)
            {
                Logger.Instance().Log(Fatal.Instance(), ex);
                throw ex;
            }
        }
示例#2
0
        public DataSet GetMenu()
        {
            string Source = "sp_getMenu";

            try
            {
                DataSet output = MySQLCommands.Instance().ExecuteQuery(Source, CommandType.StoredProcedure, null);
                return(output);
            }
            catch (Exception ex)
            {
                Logger.Instance().Log(Fatal.Instance(), ex);
                throw ex;
            }
        }
示例#3
0
 public static DataSet GetDatasetOfProvinces()
 {
     try
     {
         List <IProvince> ProvinceList  = new List <IProvince>();
         string           Source        = "sp_getProvinceList";
         Object[]         paramToken    = null;
         DataSet          OutputDataset = MySQLCommands.Instance().ExecuteQuery(Source, CommandType.StoredProcedure, paramToken);
         return(OutputDataset);
     }
     catch (Exception ex)
     {
         Logger.Instance().Log(Fatal.Instance(), ex);
         throw ex;
     }
 }
示例#4
0
 public DataSet GetTaxDetailsFromDB(int AddressID)
 {
     try
     {
         string   Source     = "sp_FetchTaxDetailsByAddressID";
         object[] parameters =
         {
             new MySqlParameter("@paramAddressID", AddressID)
         };
         return(MySQLCommands.Instance().ExecuteQuery(Source, CommandType.StoredProcedure, parameters));
     }
     catch (Exception ex)
     {
         Logger.Instance().Log(Fatal.Instance(), ex);
         throw ex;
     }
 }
示例#5
0
        public DataRow FetchAllProductByStoreID(int PBSId)
        {
            string Source = "sp_FetchProductByPBSID";

            try
            {
                Object[] param =
                {
                    new MySqlParameter("@paramPBSID", PBSId)
                };
                return(MySQLCommands.Instance().ExecuteQuery(Source, CommandType.StoredProcedure, param).Tables[0].Rows[0]);
            }
            catch (Exception ex)
            {
                Logger.Instance().Log(Fatal.Instance(), ex);
                throw ex;
            }
        }
示例#6
0
        public DataSet FetchAllProducts(int ProductID)
        {
            string Source = "sp_FetchProductsByID";

            try
            {
                Object[] param =
                {
                    new MySqlParameter("@paramProductID", ProductID)
                };
                return(MySQLCommands.Instance().ExecuteQuery(Source, CommandType.StoredProcedure, param));
            }
            catch (Exception ex)
            {
                Logger.Instance().Log(Fatal.Instance(), ex);
                throw ex;
            }
        }
示例#7
0
        public string FetchStoreImageByPBSID(int PBSID)
        {
            string Source = "sp_FetchStoreLogoFromPBSID";

            try
            {
                object[] param =
                {
                    new MySqlParameter("@paramPBSID", PBSID)
                };
                return(MySQLCommands.Instance().ExecuteQuery(Source, CommandType.StoredProcedure, param).Tables[0].Rows[0]["storeLogo"].ToString());
            }
            catch (Exception ex)
            {
                Logger.Instance().Log(Fatal.Instance(), ex);
                throw ex;
            }
        }
示例#8
0
        public DataSet FetchProfile(IUserProfile UserProfileObj)
        {
            string Source = "sp_getUserProfile";
            string Token  = UserProfileObj.GetToken();

            try
            {
                object[] parameters =
                {
                    new MySqlParameter("@paramToken", Token)
                };
                DataSet output = MySQLCommands.Instance().ExecuteQuery(Source, CommandType.StoredProcedure, parameters);
                return(output);
            }
            catch (Exception ex)
            {
                Logger.Instance().Log(Fatal.Instance(), ex);
                throw ex;
            }
        }
示例#9
0
        public DataSet CreateOrderID(IAddress AddressObj, ICardDetails CardObj, IUserProfile UserProfileObj)
        {
            string Source = "sp_CreateOrderID";

            try
            {
                object[] paramToken =
                {
                    new MySqlParameter("@aID",        AddressObj.GetAddressID()),
                    new MySqlParameter("@caID",       CardObj.GetCardID()),
                    new MySqlParameter("@paramToken", UserProfileObj.GetToken())
                };
                return(MySQLCommands.Instance().ExecuteQuery(Source, CommandType.StoredProcedure, paramToken));
            }
            catch (Exception ex)
            {
                Logger.Instance().Log(Fatal.Instance(), ex);
                throw ex;
            }
        }
示例#10
0
        public void InsertValuesToDatabase(int Oid, int Pbsid, int Quantity, double Price, double TaxAmount)
        {
            string Source = "sp_insertOrderByRow";

            try
            {
                object[] paramToken =
                {
                    new MySqlParameter("@paramoID",       Oid),
                    new MySqlParameter("@parampbsID",     Pbsid),
                    new MySqlParameter("@paramQuantity",  Quantity),
                    new MySqlParameter("@paramPrice",     Price),
                    new MySqlParameter("@paramTaxAmount", TaxAmount)
                };
                MySQLCommands.Instance().ExecuteQuery(Source, CommandType.StoredProcedure, paramToken);
            }
            catch (Exception ex)
            {
                Logger.Instance().Log(Fatal.Instance(), ex);
                throw ex;
            }
        }
示例#11
0
        public DataSet FetchOtherStoresList(int PBSID)
        {
            string Source = "sp_FetchOtherStoresThanLowestProductStoreByPBSID";

            try
            {
                object[] param =
                {
                    new MySqlParameter("@paramPBSID", PBSID)
                };
                return(MySQLCommands.Instance().ExecuteQuery(Source, CommandType.StoredProcedure, param));
            }
            catch (MySqlException mse)
            {
                Logger.Instance().Log(Fatal.Instance(), mse);
                throw mse;
            }
            catch (Exception ex)
            {
                Logger.Instance().Log(Fatal.Instance(), ex);
                throw ex;
            }
        }