Esempio n. 1
0
        /// <summary>
        /// Method to Get the Product Structures(Hierachie) to fill the Category and Subcategory Combobox
        /// </summary>
        public void GetProductStructure()
        {
            if (CategoryList.Count() > 0)
            {
                CategoryList.Clear();
            }

            if (SubCategoryList.Count() > 0)
            {
                SubCategoryList.Clear();
            }

            using (var db = new DataSmartDBContext())
            {
                var structure = db.ProductStructure.ToList();

                if (structure != null)
                {
                    foreach (var d in structure)
                    {
                        CategoryList.Add(d.Category_1);
                        SubCategoryList.Add(d.Category_2);
                    }
                    CategoryList    = CategoryList.Distinct().ToList();
                    SubCategoryList = SubCategoryList.Distinct().ToList();
                }
            }
        }
Esempio n. 2
0
 protected override bool OnNew()
 {
     this.CurrentOperation        = FormOperation.Adicionando;
     this.CurrentDocument         = new DocumentModel();
     CurrentDocument.FILE         = new FileModel();
     this.CurrentDocument.FILE_ID = 0;
     if (CategoryList != null && CategoryList.Count() > 0)
     {
         this.CurrentDocument.CATEGORY_ID = CategoryList.First().ID;
     }
     return(true);
 }
Esempio n. 3
0
        /// <summary> 請求区分設定 </summary>
        private async Task LoadBillingCategoryCombo()
        {
            CategoriesResult result = null;
            await ServiceProxyFactory.LifeTime(async factory =>
            {
                var service = factory.Create <CategoryMasterClient>();
                result      = await service.GetByCodeAsync(SessionKey, CompanyId, 1, new string[] { });
            });

            if (result.ProcessResult.Result)
            {
                CategoryList = result.Categories;
                cmbSeikyuKubun.Items.Add(new ListItem("すべて", 0));
                for (int i = 0; i < CategoryList.Count(); i++)
                {
                    cmbSeikyuKubun.Items.Add(new ListItem(CategoryList[i].Code + " : " + CategoryList[i].Name, CategoryList[i].Id));
                }
                cmbSeikyuKubun.SelectedIndex = 0;
            }
        }
        public ActionResult Manage(Guid Id)
        {
            Product model = new Product();

            //Fabric List Box
            var        FabricDt   = pem.GetFabric();
            SelectList FabricList = new SelectList((IEnumerable <object>)FabricDt, "FabricId", "FabricName");

            if (FabricList.Count() > 0)
            {
                FabricList = new SelectList((IEnumerable <object>)FabricDt, "FabricId", "FabricName");
                //FabricList = new SelectList((IEnumerable<object>)FabricDt, "FabricId", "FabricName", FabricList.Count() > 0 ? FabricList.Last().Value : "0");
            }
            ViewBag.FabricList = FabricList;

            //Pattern List Box
            var        PatternDt   = pem.GetPattern();
            SelectList PatternList = new SelectList((IEnumerable <object>)PatternDt, "PatternId", "PatternName");

            if (PatternList.Count() > 0)
            {
                PatternList = new SelectList((IEnumerable <object>)PatternDt, "PatternId", "PatternName");
                //FabricList = new SelectList((IEnumerable<object>)FabricDt, "FabricId", "FabricName", FabricList.Count() > 0 ? FabricList.Last().Value : "0");
            }
            ViewBag.PatternList = PatternList;

            //Category List Box
            var        CategoryDt   = pem.GetCategory();
            SelectList CategoryList = new SelectList((IEnumerable <object>)CategoryDt, "CategoryId", "CategoryName");

            if (CategoryList.Count() > 0)
            {
                CategoryList = new SelectList((IEnumerable <object>)CategoryDt, "CategoryId", "CategoryName");
            }
            else
            {
                CategoryList = new SelectList((IEnumerable <object>)CategoryDt, "CategoryId", "CategoryName", CategoryList.Count() == 0 ? "0" : "Select  Category");
            }
            ViewBag.CategoryList = CategoryList;

            //SubCategory List Box
            //var SubCategoryDt = pem.GetSubCategory();
            //SelectList SubCategoryList = new SelectList((IEnumerable<object>)SubCategoryDt, "SubCategoryId", "SubCategoryName");
            //if (SubCategoryList.Count() > 0)
            //{
            //    SubCategoryList = new SelectList((IEnumerable<object>)SubCategoryDt, "SubCategoryId", "SubCategoryName");
            //}
            //else
            //{
            //    SubCategoryList = new SelectList((IEnumerable<object>)SubCategoryDt, "SubCategoryId", "SubCategoryName", SubCategoryList.Count() == 0 ? "0" : "Select Sub Category");
            //}
            //ViewBag.SubCategoryList = SubCategoryList;


            //Color List Box
            var        ColorDt   = pem.GetColor();
            SelectList ColorList = new SelectList((IEnumerable <object>)ColorDt, "ColorId", "ColorName");

            if (ColorList.Count() > 0)
            {
                ColorList = new SelectList((IEnumerable <object>)ColorDt, "ColorId", "ColorName");
            }
            ViewBag.ColorList = ColorList;

            //Cloth Design/Style List Box
            var        StyleDt   = pem.GetStyle();
            SelectList StyleList = new SelectList((IEnumerable <object>)StyleDt, "StyleId", "StyleName");

            if (StyleList.Count() > 0)
            {
                StyleList = new SelectList((IEnumerable <object>)StyleDt, "StyleId", "StyleName");
                //FabricList = new SelectList((IEnumerable<object>)FabricDt, "FabricId", "FabricName", FabricList.Count() > 0 ? FabricList.Last().Value : "0");
            }
            ViewBag.StyleList = StyleList;

            //SareeBorder List Box
            var        SareeBorderDt   = pem.GetSareeBorder();
            SelectList SareeBorderList = new SelectList((IEnumerable <object>)SareeBorderDt, "SareeBorderId", "SareeBorderName");

            if (SareeBorderList.Count() > 0)
            {
                SareeBorderList = new SelectList((IEnumerable <object>)SareeBorderDt, "SareeBorderId", "SareeBorderName");
                //FabricList = new SelectList((IEnumerable<object>)FabricDt, "FabricId", "FabricName", FabricList.Count() > 0 ? FabricList.Last().Value : "0");
            }
            ViewBag.SareeBorderList = SareeBorderList;

            ViewBag.OccasionTypes = from Occasion item in Enum.GetValues(typeof(Occasion))
                                    select new SelectListItem
            {
                Text  = item.ToString().Replace("_", " "),
                Value = Convert.ToInt32(item).ToString()
            };

            ViewBag.PackagingTypes = from PackagingType item in Enum.GetValues(typeof(PackagingType))
                                     select new SelectListItem
            {
                Text  = item.ToString().Replace("_", " "),
                Value = Convert.ToInt32(item).ToString()
            };
            ViewBag.SareeLength = pem.GetLength();

            return(View(model));
        }
        public ActionResult Manage(Guid Id)
        {
            if (Id == null)
            {
                return(HttpNotFound());
            }
            ViewBag.PageType = "Add";
            SubCategory model = new SubCategory();

            if (Id != null && Id != Guid.Parse("00000000-0000-0000-0000-000000000000"))
            {
                //Category List Box
                var        CategoryDt   = pem.GetCategory();
                SelectList CategoryList = new SelectList((IEnumerable <object>)CategoryDt, "CategoryId", "CategoryName");
                if (CategoryList.Count() > 0)
                {
                    CategoryList = new SelectList((IEnumerable <object>)CategoryDt, "CategoryId", "CategoryName");
                }
                else
                {
                    CategoryList = new SelectList((IEnumerable <object>)CategoryDt, "CategoryId", "CategoryName", CategoryList.Count() == 0 ? "0" : "Select  Category");
                }
                ViewBag.CategoryList = CategoryList;

                ViewBag.PageType = "Edit";
                model            = scem.SubCategorySelectSubCategoryById(Id);
                return(View(model));
            }
            else if (Id != null && Id == Guid.Parse("00000000-0000-0000-0000-000000000000"))
            {
                //Category List Box
                var        CategoryDt   = pem.GetCategory();
                SelectList CategoryList = new SelectList((IEnumerable <object>)CategoryDt, "CategoryId", "CategoryName");
                if (CategoryList.Count() > 0)
                {
                    CategoryList = new SelectList((IEnumerable <object>)CategoryDt, "CategoryId", "CategoryName");
                }
                else
                {
                    CategoryList = new SelectList((IEnumerable <object>)CategoryDt, "CategoryId", "CategoryName", CategoryList.Count() == 0 ? "0" : "Select  Category");
                }
                ViewBag.CategoryList = CategoryList;

                return(View(model));
            }
            return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
        }