Beispiel #1
0
        public static IEnumerable <SelectListItem> GetAllSizes()
        {
            var response = BarCodeDAL.GetAllSizes();

            response.Add(new Size()
            {
                Id = 0, Name = "Others"
            });

            var selectList = new List <SelectListItem>();

            foreach (var element in response)
            {
                selectList.Add(new SelectListItem
                {
                    Value = element.Id.ToString(),
                    Text  = element.Name
                });
            }
            return(selectList);
        }
Beispiel #2
0
        public static void ValidateBarCodeProperties(BarCodeDTO dto)
        {
            var depts = GetAllDepts();

            if (depts.All(d => d.Text != dto.Dept))
            {
                BarCodeDAL.SaveBarCodeProperties("Dept", dto.Dept);
            }

            var crafts = GetAllCrafts();

            if (crafts.All(d => d.Text != dto.Craft))
            {
                BarCodeDAL.SaveBarCodeProperties("Craft", dto.Craft);
            }

            var qualitys = GetAllQualitys();

            if (qualitys.All(d => d.Text != dto.Quality))
            {
                BarCodeDAL.SaveBarCodeProperties("Quality", dto.Quality);
            }

            var sizes = GetAllSizes();

            if (sizes.All(d => d.Text != dto.Size))
            {
                BarCodeDAL.SaveBarCodeProperties("Size", dto.Size);
            }

            var vendors = GetAllVendors();

            if (vendors.All(d => d.Text != dto.Vendor))
            {
                BarCodeDAL.SaveBarCodeProperties("Vendor", dto.Vendor);
            }
        }
Beispiel #3
0
 public static void SaveProduct(ProductInfo product)
 {
     BarCodeDAL.SaveProduct(product);
 }
Beispiel #4
0
 public static string GetBarCodeFilePathByBarCode(string currentBarCode)
 {
     return(BarCodeDAL.GetBarCodeFilePathByBarCode(currentBarCode));
 }
Beispiel #5
0
 public static string ValidateOrCreateBarCode(string barCodeValue, float mrp)
 {
     return(BarCodeDAL.ValidateOrCreateBarCode(barCodeValue, mrp));
 }
Beispiel #6
0
 public static void SaveBarCode(BarCodeDTO dto, string barCodeValue, string relativePath)
 {
     BarCodeDAL.SaveBarCode(dto, barCodeValue, relativePath);
 }