Esempio n. 1
0
        public List <ProductsMaster> GetProductListByProductName(string hSNPrefix)
        {
            DAL_Products          dAL_Products = new DAL_Products();
            List <ProductsMaster> listProduct  = new List <ProductsMaster>();

            listProduct = dAL_Products.GetProductListByProductName(hSNPrefix);
            return(listProduct);
        }
Esempio n. 2
0
 public static List <Product> GetAll()
 {
     try
     {
         return(DAL_Products.GetAll());
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 3
0
 private static void Create(Product model)
 {
     try
     {
         DAL_Products.Create(model);
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 4
0
        /// <summary>
        /// Saves the products data to DB
        /// </summary>
        /// <param name="dt"></param>
        public List <ProductsMaster> SaveProductsData(DataTable dt, Requester requester)
        {
            DAL_Products          dAL_Products = new DAL_Products();
            DAL_Common            dAL_Common   = new DAL_Common();
            List <ProductsMaster> listProduct  = new List <ProductsMaster>();
            UserMaster            userMaster   = new UserMaster();

            userMaster = dAL_Common.GetUserdetailsByUsername(requester.Name);
            if (dt != null & dt.Rows.Count > 0)
            {
                foreach (DataRow row in dt.Rows)
                {
                    ProductsMaster product = new ProductsMaster();
                    product.Name           = Convert.ToString(row["Name"]);
                    product.HSNCode        = Convert.ToString(row["HSNCode"] is DBNull ? DBNull.Value : row["HSNCode"]);
                    product.SACCode        = Convert.ToString(row["SACCode"] is DBNull ? DBNull.Value : row["SACCode"]);
                    product.Description    = Convert.ToString(row["Description"]);
                    product.CessPercentage = Convert.ToString(row["CessPercentage"]);
                    product.GSTPercentage  = Convert.ToString(row["GSTPercentage"]).Equals("NIL", StringComparison.InvariantCultureIgnoreCase) ? null : Convert.ToString(row["GSTPercentage"]);
                    product.IsActive       = true;
                    product.CreatedOn      = DateTime.Now;
                    product.UpdatedOn      = DateTime.Now;
                    if (userMaster != null)
                    {
                        product.CreatedBy = userMaster.ID;
                        product.UpdatedBy = userMaster.ID;
                    }
                    else
                    {
                        product.CreatedBy = 1;
                        product.UpdatedBy = 1;
                    }
                    listProduct.Add(product);
                }
                return(dAL_Products.SaveProductsData(listProduct));
            }
            return(listProduct);
        }
Esempio n. 5
0
        public bool CreateNewProductBillMapping(BillProductMapping productBillMapp)
        {
            DAL_Products dAL_Products = new DAL_Products();

            return(dAL_Products.CreateNewProductBillMapping(productBillMapp));
        }
Esempio n. 6
0
        public long CreateNewProduct(ProductsMaster products)
        {
            DAL_Products dAL_Products = new DAL_Products();

            return(dAL_Products.CreateNewProduct(products));
        }
Esempio n. 7
0
        public bool CheckIfProductExistBySACCode(string sACCode, out long productID)
        {
            DAL_Products dAL_Products = new DAL_Products();

            return(dAL_Products.CheckIfProductExistBySACode(sACCode, out productID));
        }
Esempio n. 8
0
        public List <ProductsMaster> GetAllProductList()
        {
            DAL_Products dAL_Products = new DAL_Products();

            return(dAL_Products.GetAllProductList());
        }