Exemplo n.º 1
0
        public IEnumerable <T> GetFurtherDetail <T>(string packId, string drillDownDetail)
        {
            string _query = "";

            Dictionary <string, string> queryTable = new Dictionary <string, string>()
            {
                { "Department", "Fetch_DepartmentDetails" },
                { "PackCodes", "Fetch_PackCodes" },
                { "Product", "Fetch_ProductDetails" },
                { "Size", "Fetch_SizeDetails" }
            };

            if (queryTable.Keys.Contains(drillDownDetail))
            {
                _query = queryTable[drillDownDetail];
            }

            using (new SharedConnection(dbConnection))
            {
                var result = dbConnection.Query <T>(SqlLoader.GetSql(_query),
                                                    packId
                                                    );

                return(result.Any() ? result : default(IEnumerable <T>));
            }
        }
Exemplo n.º 2
0
 public string GetNextPackID()
 {
     using (new SharedConnection(dbConnection))
     {
         var result = dbConnection.Query <string>(SqlLoader.GetSql("Fetch_NextPackID"));
         return(result.Any() ? result.First() : null);
     }
 }
Exemplo n.º 3
0
        public IEnumerable <Size_Details> GetSizes_ForSizeRange(string sizeRange)
        {
            using (new SharedConnection(dbConnection))
            {
                var result = dbConnection.Query <Size_Details>(SqlLoader.GetSql("Fetch_SizesBySizeRange"), sizeRange);

                return(result.Any() ? result : null);
            }
        }
Exemplo n.º 4
0
        public IEnumerable <Size_Ranges> GetAllSizeRanges()
        {
            using (new SharedConnection(dbConnection))
            {
                var result = dbConnection.Query <Size_Ranges>(SqlLoader.GetSql("Fetch_AllSizeRanges"));

                return(result.Any() ? result : null);
            }
        }
Exemplo n.º 5
0
        public IEnumerable <Filter_Data> GetAllSubRanges()
        {
            using (new SharedConnection(dbConnection))
            {
                var result = dbConnection.Query <Filter_Data>(SqlLoader.GetSql("Fetch_AllActiveSubRanges"));

                return(result.Any() ? result : null);
            }
        }
Exemplo n.º 6
0
 public Product_Details GetProductDetails(string packId)
 {
     using (new SharedConnection(dbConnection))
     {
         var result = dbConnection.Query <Product_Details>(SqlLoader.GetSql("Fetch_ProductDetails"),
                                                           packId
                                                           );
         return(result.Any() ? result.First() : null);
     }
 }
Exemplo n.º 7
0
 public void Insert_NewPackHeader(New_Pack newPack)
 {
     using (new SharedConnection(dbConnection))
     {
         dbConnection.Execute(SqlLoader.GetSql("Insert_NewPackHeader"),
                              newPack.PackId,
                              newPack.PackName,
                              newPack.Return_TotalSizes_ToInt(),
                              newPack.Return_TotalUnits_ToInt()
                              );
     }
 }
Exemplo n.º 8
0
 public IEnumerable <Raw_Pack_Data> GetAllPacks(Filter_Parameters filterParams)
 {
     using (new SharedConnection(dbConnection))
     {
         var result = dbConnection.Query <Raw_Pack_Data>(SqlLoader.GetSql("Fetch_Packs"),
                                                         filterParams.Department,
                                                         filterParams.Sub_Department,
                                                         filterParams.Section,
                                                         filterParams.Range,
                                                         filterParams.Sub_Range
                                                         );
         return(result.Any() ? result : null);
     }
 }