protected override void OnInitialize()
 {
     CategoryLogic.LoadDefinition(Flow.Session);
     IList list = null;
     list = Flow.Session.Get(FlowConstants.CATEGORY_LIST) as IList;
     //if (list == null) list = new ArrayList();
     ProductCategoryList = list;
     SelectedProductCategory = new Category();
 }
Example #2
0
        protected bool Equals(Category entity)
        {
            if (entity == null) return false;
            if (!base.Equals(entity)) return false;

            return true;
        }
Example #3
0
 public void Delete(Category data)
 {
     CategoryDao.Delete(data);
 }
Example #4
0
 public Category Add(Category data)
 {
     CategoryDao.Add(data);
     return data;
 }
Example #5
0
 public void Update(Category data)
 {
     CategoryDao.Update(data);
 }
        protected override void OnInitialize()
        {
            ProductTypeList = new ArrayList();
            CategoryList = new ArrayList();
            ProductMasterPriceList = new List<MainPrice>();
            IList typeList = (IList)Flow.Session.Get(FlowConstants.PRODUCT_TYPE_LIST);
            IList catList = (IList)Flow.Session.Get(FlowConstants.CATEGORY_LIST);
            ProductType allProductType = new ProductType
                                             {
                                                 TypeId = 0,
                                                 TypeName = "---- TẤT CẢ CHỦNG LOẠI ----"
                                             };
            Category allCategory = new Category
                                       {
                                           CategoryId = 0,
                                           CategoryName = "---- TẤT CẢ NHÓM ----"
                                       };

            if (typeList.Count > 0)
            {
                IList preparedTypeList = new ArrayList();
                preparedTypeList.Add(allProductType);
                foreach (var type in typeList)
                {
                    preparedTypeList.Add(type);
                }
                ProductTypeList = preparedTypeList;
            }
            if (catList.Count > 0)
            {
                IList preparedCatList = new ArrayList();
                preparedCatList.Add(allCategory);
                foreach (var type in catList)
                {
                    preparedCatList.Add(type);
                }
                CategoryList = preparedCatList;
            }

            _allMainPriceList = (IList<MainPrice>)Flow.Session.Get(FlowConstants.MAINPRICE_LIST);
        }