Exemple #1
0
 public AddToPurchaseInvoice()
 {
     supLay    = new SupplierLayer();
     purLayer  = new PurchaseInvoiceLayer();
     catLay    = new CategoryLayer();
     itmLay    = new ItemLayer();
     ItmpurLay = new ItemInPurchaseLayer();
     baseLayer = new Base();
     InitializeComponent();
 }
Exemple #2
0
 public AddToSpecialInvoice()
 {
     salLay    = new SalesManLayer();
     recLayer  = new ReceiptInvoiceLayer();
     catLay    = new CategoryLayer();
     itmLay    = new ItemLayer();
     ItmrecLay = new ItemInReceiptInvoiceLayer();
     baseLayer = new Base();
     InitializeComponent();
 }
        public Category InitilizeCategoryByCategoryLayer()
        {
            CategoryLayer categoryLayer = new CategoryLayer();
            Category      category      = new Category();

            category.ParentCatID  = categoryLayer.ParentCatID;
            category.Name         = categoryLayer.Name;
            category.DisplayOrder = categoryLayer.DisplayOrder;
            category.IsActive     = categoryLayer.IsActive;

            return(category);
        }
Exemple #4
0
 public ReceiptInvoices()
 {
     InitializeComponent();
     cat     = new CategoryLayer();
     sales   = new SalesManLayer();
     context = new Context();
     CategoryCombo.SelectedValuePath = "ID";
     CategoryCombo.DisplayMemberPath = "Name";
     CategoryCombo.ItemsSource       = cat.GetAllCategories().ToList();
     SalesManCombo.SelectedValuePath = "ID";
     SalesManCombo.DisplayMemberPath = "Name";
     SalesManCombo.ItemsSource       = sales.GetAllSalesMan().ToList();
     Edit.IsEnabled   = false;
     Delete.IsEnabled = false;
 }
Exemple #5
0
        protected void btnAddCategory_Click(object sender, EventArgs e)
        {
            ProductDbContext productDbContext = new ProductDbContext();
            CategoryLayer    categoryLayer    = new CategoryLayer();
            Category         category         = new Category();

            categoryLayer.ParentCatID  = Convert.ToInt32(txtCategoryID.Text);
            categoryLayer.Name         = txtCategoryName.Text;
            categoryLayer.IsActive     = chkIsActive.Checked;
            categoryLayer.DisplayOrder = Convert.ToInt32(txtDisplayOrder.Text);

            category.ParentCatID  = categoryLayer.ParentCatID;
            category.Name         = categoryLayer.Name;
            category.DisplayOrder = categoryLayer.DisplayOrder;
            category.IsActive     = categoryLayer.IsActive;

            productDbContext.Categories.Add(category);
            productDbContext.SaveChanges();
            GridView1.DataBind();
            ClearCategoryInputField();
        }
 public static Category GetCategoryById(string CategoryId)
 {
     return(CategoryLayer.GetCategoryById(CategoryId));
 }
 public static List <Category> GetCategory()
 {
     return(CategoryLayer.GetCategory());
 }