示例#1
0
 public static void loadStocks(MSComboBox comboBox, String type)
 {
     try {
         if (stockLocationDataTable == null)
         {
             stockLocationDataTable = new DataTable();
             stockLocationDataTable.Columns.Add("ID", typeof(int));
             stockLocationDataTable.Columns.Add("name", typeof(String));
         }
         else
         {
             stockLocationDataTable.Rows.Clear();
         }
         List <StockLocation> list = stockManagerImpl.getActivedStockLocations();
         foreach (StockLocation stockLocation in list)
         {
             stockLocationDataTable.Rows.Add(stockLocation.Id, stockLocation.Name);
         }
         comboBox.OptionGroup   = stockLocationDataTable;
         comboBox.SelectedIndex = 0;
         if (type == "b")
         {
             comboBox.SelectedValue = Convert.ToInt32(Session.Preference["defaultBuyingStock"]);
         }
         else if (type == "s")
         {
             comboBox.SelectedValue = Convert.ToInt32(Session.Preference["defaultSellingStock"]);
         }
         else
         {
             comboBox.SelectedIndex = 0;
         }
     } catch (Exception) {
     }
 }
 public BankManagerControler(AddBank addBank, MSComboBox mSComboBox)
 {
     // TODO: Complete member initialization
     this.addBank    = addBank;
     this.mSComboBox = mSComboBox;
     bankManagerImpl = new BankManagerImpl(addBank);
 }
示例#3
0
 internal static void itemsForCategoryAndCompany(MSComboBox comboBox_item_selectItem, int categoryId, int companyId)
 {
     try {
         DataTable data = new DataTable();
         data.Columns.Add("ID", typeof(int));
         data.Columns.Add("name", typeof(String));
         data.Rows.Add(0, "- Select -");
         if (categoryId > 0 || companyId > 0)
         {
             if (categoryId < 1)
             {
                 categoryId = -1;
             }
             if (companyId < 1)
             {
                 companyId = -1;
             }
             List <Item> list = itemManagerImpl.getItemsForCategoryAndCompany(categoryId, companyId);
             foreach (Item item in list)
             {
                 data.Rows.Add(item.Id, item.Name);
             }
         }
         comboBox_item_selectItem.OptionGroup   = data;
         comboBox_item_selectItem.SelectedIndex = 0;
     } catch (Exception) {
     }
 }
示例#4
0
 public static void sellingPriceForItemAndMode(MSComboBox comboBox, int itemId, String mode, AddSellingPrice addSellingPrice)
 {
     try {
         DataTable dataTable = new DataTable();
         dataTable.Columns.Add("ID", typeof(int));
         dataTable.Columns.Add("price", typeof(String));
         List <SellingPrice> list = sellingPriceManagerImpl.getSellingPriceByItemAndMode(itemId, mode);
         foreach (SellingPrice sellingPrice in list)
         {
             dataTable.Rows.Add(sellingPrice.Id, sellingPrice.Price.ToString("#,##0.00"));
         }
         if (Session.Permission["canAddSellingPrice"] == 1)
         {
             comboBox.AddLinkWindow   = addSellingPrice;
             addSellingPrice.Mode     = mode;
             addSellingPrice.ItemId   = itemId;
             addSellingPrice.ComboBox = comboBox;
         }
         else
         {
             comboBox.AddLinkWindow = null;
         }
         int index = dataTable.Rows.Count - 1;
         comboBox.OptionGroup = dataTable;
         if (index > -1)
         {
             comboBox.SelectedIndex = index;
         }
     } catch (Exception) {
     }
 }
示例#5
0
 public CustomerManagerControler(AddCustomer addCustomer, MSComboBox mSComboBox)
 {
     // TODO: Complete member initialization
     this.addCustomer    = addCustomer;
     this.mSComboBox     = mSComboBox;
     customerManagerImpl = new CustomerManagerImpl(addCustomer);
 }
 public CompanyManagerControler(AddCompany addCompany, MSComboBox mSComboBox)
 {
     // TODO: Complete member initialization
     this.addCompany    = addCompany;
     this.mSComboBox    = mSComboBox;
     companyManagerImpl = new CompanyManagerImpl(addCompany);
 }
示例#7
0
 public static void vendorsForAddBuyingInvoice(MSComboBox comboBox)
 {
     try {
         if (vendorDataTable == null)
         {
             vendorDataTable = new DataTable();
             vendorDataTable.Columns.Add("ID", typeof(int));
             vendorDataTable.Columns.Add("name", typeof(String));
         }
         else
         {
             vendorDataTable.Rows.Clear();
         }
         List <Vendor> list = vendorManagerImpl.getAllActivedVendors();
         foreach (Vendor vendor in list)
         {
             vendorDataTable.Rows.Add(vendor.Id, vendor.Name);
         }
         if (Session.Permission["canAddVendor"] == 1 && comboBox.AddLinkWindow == null)
         {
             if (addVendor == null)
             {
                 addVendor = new AddVendor(comboBox);
             }
             comboBox.AddLinkWindow = addVendor;
         }
         comboBox.IsPermissionDenied = Session.Permission["canAddVendor"] == 0 ? true : false;
         comboBox.OptionGroup        = vendorDataTable;
     } catch (Exception) {
     }
 }
示例#8
0
 public void customersForAddSellingInvoice(MSComboBox comboBox)
 {
     try {
         if (this.customerDataTable == null)
         {
             this.customerDataTable = new DataTable();
             this.customerDataTable.Columns.Add("ID", typeof(int));
             this.customerDataTable.Columns.Add("name", typeof(String));
         }
         else
         {
             this.customerDataTable.Rows.Clear();
         }
         List <Customer> list = customerManagerImpl.getAllActivedCustomers();
         foreach (Customer customer in list)
         {
             customerDataTable.Rows.Add(customer.Id, customer.Name);
         }
         if (Session.Permission["canAddCustomer"] == 1 && comboBox.AddLinkWindow == null)
         {
             if (addCustomer == null)
             {
                 addCustomer = new AddCustomer(comboBox);
             }
             comboBox.AddLinkWindow = addCustomer;
         }
         comboBox.IsPermissionDenied = Session.Permission["canAddCustomer"] == 0 ? true : false;
         comboBox.OptionGroup        = customerDataTable;
         comboBox.SelectedValue      = 1;
     } catch (Exception) {
     }
 }
示例#9
0
 public static void unitsForAddItem(MSComboBox comboBox)
 {
     try {
         if (unitDataTable == null)
         {
             unitDataTable = new DataTable();
             unitDataTable.Columns.Add("ID", typeof(int));
             unitDataTable.Columns.Add("name", typeof(String));
         }
         else
         {
             unitDataTable.Rows.Clear();
         }
         List <Unit> list = unitManagerImpl.get(new Unit());
         foreach (Unit unit in list)
         {
             unitDataTable.Rows.Add(unit.Id, unit.Name);
         }
         if (Session.Permission["canAddUnit"] == 1 && comboBox.AddLinkWindow == null)
         {
             if (addUnit == null)
             {
                 addUnit = new AddUnit(comboBox);
             }
             comboBox.AddLinkWindow = addUnit;
         }
         comboBox.IsPermissionDenied = Session.Permission["canAddUnit"] == 0 ? true : false;
         comboBox.OptionGroup        = unitDataTable;
         comboBox.SelectedIndex      = 0;
     } catch (Exception) {
     }
 }
示例#10
0
 public static void unitsForFilter(MSComboBox comboBox)
 {
     try {
         if (unitDataTableFilter == null)
         {
             unitDataTableFilter = new DataTable();
             unitDataTableFilter.Columns.Add("ID", typeof(int));
             unitDataTableFilter.Columns.Add("name", typeof(String));
         }
         else
         {
             unitDataTableFilter.Rows.Clear();
         }
         List <Unit> list = unitManagerImpl.get(new Unit());
         unitDataTableFilter.Rows.Add(-1, "All");
         foreach (Unit unit in list)
         {
             unitDataTableFilter.Rows.Add(unit.Id, unit.Name);
         }
         comboBox.IsPermissionDenied = Session.Permission["canAddUnit"] == 0 ? true : false;
         comboBox.OptionGroup        = unitDataTableFilter;
         comboBox.SelectedIndex      = 0;
     } catch (Exception) {
     }
 }
示例#11
0
 public static void banksForSelect(MSComboBox comboBox)
 {
     try {
         if (bankDataTable == null)
         {
             bankDataTable = new DataTable();
             bankDataTable.Columns.Add("ID", typeof(int));
             bankDataTable.Columns.Add("name", typeof(String));
         }
         else
         {
             bankDataTable.Rows.Clear();
         }
         List <Bank> list = bankManagerImpl.getAllBanks();
         foreach (Bank bank in list)
         {
             bankDataTable.Rows.Add(bank.Id, bank.Name);
         }
         if (Session.Permission["canAddBank"] == 1 && comboBox.AddLinkWindow == null)
         {
             if (addBank == null)
             {
                 addBank = new AddBank(comboBox);
             }
             comboBox.AddLinkWindow = addBank;
         }
         comboBox.IsPermissionDenied = Session.Permission["canAddBank"] == 0 ? true : false;
         comboBox.OptionGroup        = bankDataTable;
     } catch (Exception) {
     }
 }
示例#12
0
 public static void vendorsForFilter(MSComboBox comboBox)
 {
     try {
         if (vendorDataTableFilter == null)
         {
             vendorDataTableFilter = new DataTable();
             vendorDataTableFilter.Columns.Add("ID", typeof(int));
             vendorDataTableFilter.Columns.Add("name", typeof(String));
         }
         else
         {
             vendorDataTableFilter.Rows.Clear();
         }
         List <Vendor> list = vendorManagerImpl.getAllActivedVendors();
         vendorDataTableFilter.Rows.Add(-1, "All");
         foreach (Vendor vendor in list)
         {
             vendorDataTableFilter.Rows.Add(vendor.Id, vendor.Name);
         }
         comboBox.IsPermissionDenied = Session.Permission["canAddVendor"] == 0 ? true : false;
         comboBox.OptionGroup        = vendorDataTableFilter;
         comboBox.SelectedIndex      = 0;
     } catch (Exception) {
     }
 }
示例#13
0
 public static void usersForFilter(MSComboBox comboBox)
 {
     try {
         if (userDataTable == null)
         {
             userDataTable = new DataTable();
             userDataTable.Columns.Add("ID", typeof(int));
             userDataTable.Columns.Add("name", typeof(String));
         }
         else
         {
             userDataTable.Rows.Clear();
         }
         List <User> list = userManagerImpl.getAllUsers();
         userDataTable.Rows.Add(-1, "All");
         foreach (User user in list)
         {
             /*if(user.IsFake == 0) {
              *      userDataTable.Rows.Add(user.Id, user.FirstName + " " + user.LastName);
              * }*/
             userDataTable.Rows.Add(user.Id, user.FirstName + " " + user.LastName);
         }
         comboBox.OptionGroup   = userDataTable;
         comboBox.SelectedIndex = 0;
     } catch (Exception) {
     }
 }
示例#14
0
        public static void yesNoForAdd(MSComboBox comboBox)
        {
            try {
                if (yesNoForAddDataTable == null)
                {
                    yesNoForAddDataTable = new DataTable();
                    yesNoForAddDataTable.Columns.Add("ID", typeof(int));
                    yesNoForAddDataTable.Columns.Add("name", typeof(String));

                    yesNoForAddDataTable.Rows.Add(1, "Yes");
                    yesNoForAddDataTable.Rows.Add(0, "No");
                }
                comboBox.OptionGroup   = yesNoForAddDataTable;
                comboBox.SelectedIndex = 0;
            } catch (Exception) {
            }
        }
示例#15
0
        public static void reason(MSComboBox comboBox)
        {
            try {
                if (reasonDataTable == null)
                {
                    reasonDataTable = new DataTable();
                    reasonDataTable.Columns.Add("ID", typeof(int));
                    reasonDataTable.Columns.Add("name", typeof(String));

                    reasonDataTable.Rows.Add(1, "Normal");
                    reasonDataTable.Rows.Add(2, "CR");
                    reasonDataTable.Rows.Add(3, "GR");
                    reasonDataTable.Rows.Add(4, "WR");
                }
                comboBox.OptionGroup = reasonDataTable;
            } catch (Exception) {
            }
        }
示例#16
0
        public static void sellingInvoiceStatusForSelect(MSComboBox comboBox)
        {
            try {
                if (sellingInvoiceStatusDataTable == null)
                {
                    sellingInvoiceStatusDataTable = new DataTable();
                    sellingInvoiceStatusDataTable.Columns.Add("ID", typeof(int));
                    sellingInvoiceStatusDataTable.Columns.Add("name", typeof(String));

                    sellingInvoiceStatusDataTable.Rows.Add(-1, "All");
                    sellingInvoiceStatusDataTable.Rows.Add(1, "Sold");
                    sellingInvoiceStatusDataTable.Rows.Add(3, "Draft");
                }
                comboBox.OptionGroup   = sellingInvoiceStatusDataTable;
                comboBox.SelectedIndex = 0;
            } catch (Exception) {
            }
        }
示例#17
0
        public static void chequeStatus(MSComboBox comboBox)
        {
            try {
                if (chequeStatusDataTable == null)
                {
                    chequeStatusDataTable = new DataTable();
                    chequeStatusDataTable.Columns.Add("ID", typeof(int));
                    chequeStatusDataTable.Columns.Add("name", typeof(String));

                    chequeStatusDataTable.Rows.Add(-1, "All");
                    chequeStatusDataTable.Rows.Add(0, "On Hand");
                    chequeStatusDataTable.Rows.Add(1, "Banked");
                    chequeStatusDataTable.Rows.Add(2, "Changed");
                    chequeStatusDataTable.Rows.Add(3, "Returned");
                }
                comboBox.OptionGroup = chequeStatusDataTable;
            } catch (Exception) {
            }
        }
示例#18
0
 public static void banksForFilter(MSComboBox comboBox)
 {
     try {
         if (bankDataTableFilter == null)
         {
             bankDataTableFilter = new DataTable();
             bankDataTableFilter.Columns.Add("ID", typeof(int));
             bankDataTableFilter.Columns.Add("name", typeof(String));
         }
         else
         {
             bankDataTableFilter.Rows.Clear();
         }
         bankDataTableFilter.Rows.Add(-1, "All");
         List <Bank> list = bankManagerImpl.getAllBanks();
         foreach (Bank bank in list)
         {
             bankDataTableFilter.Rows.Add(bank.Id, bank.Name);
         }
         comboBox.OptionGroup = bankDataTableFilter;
     } catch (Exception) {
     }
 }
示例#19
0
 public static void loadStocksForFilter(MSComboBox comboBox)
 {
     try {
         if (stockLocationDataTableFilter == null)
         {
             stockLocationDataTableFilter = new DataTable();
             stockLocationDataTableFilter.Columns.Add("ID", typeof(int));
             stockLocationDataTableFilter.Columns.Add("name", typeof(String));
         }
         else
         {
             stockLocationDataTableFilter.Rows.Clear();
         }
         List <StockLocation> list = stockManagerImpl.getActivedStockLocations();
         stockLocationDataTableFilter.Rows.Add(-1, "All");
         foreach (StockLocation stockLocation in list)
         {
             stockLocationDataTableFilter.Rows.Add(stockLocation.Id, stockLocation.Name);
         }
         comboBox.OptionGroup   = stockLocationDataTableFilter;
         comboBox.SelectedIndex = 0;
     } catch (Exception) {
     }
 }
示例#20
0
 public static void companiesForSelect(MSComboBox comboBox)
 {
     try {
         if (companyDataTable == null)
         {
             companyDataTable = new DataTable();
             companyDataTable.Columns.Add("ID", typeof(int));
             companyDataTable.Columns.Add("name", typeof(String));
         }
         else
         {
             companyDataTable.Rows.Clear();
         }
         companyDataTable.Rows.Add(0, "- Select -");
         List <Company> coms = companyManagerImpl.getAllCompanies();
         foreach (Company company in coms)
         {
             companyDataTable.Rows.Add(company.Id, company.Name);
         }
         comboBox.OptionGroup   = companyDataTable;
         comboBox.SelectedIndex = 0;
     } catch (Exception) {
     }
 }
示例#21
0
 internal static void companiesForCategory(MSComboBox comboBox_company_selectItem, int categoryId)
 {
     try {
         if (categoryId == 0)
         {
             companiesForSelect(comboBox_company_selectItem);
         }
         else
         {
             List <int> companyIds = itemManagerImpl.getCompanyIdsForCategory(categoryId);
             DataTable  data       = new DataTable();
             data.Columns.Add("ID", typeof(int));
             data.Columns.Add("name", typeof(String));
             data.Rows.Add(0, "- Select -");
             foreach (int id in companyIds)
             {
                 data.Rows.Add(id, companyManagerImpl.getCompanyNameById(id));
             }
             comboBox_company_selectItem.OptionGroup   = data;
             comboBox_company_selectItem.SelectedIndex = 0;
         }
     } catch (Exception) {
     }
 }
示例#22
0
 public UnitManagerControler(AddUnit addUnit, MSComboBox mSComboBox)
 {
     this.addUnit    = addUnit;
     this.mSComboBox = mSComboBox;
     unitManagerImpl = new UnitManagerImpl(addUnit);
 }
示例#23
0
 public CategoryManagerControler(AddCategory addCategory, MSComboBox mSComboBox)
 {
     this.addCategory    = addCategory;
     this.mSComboBox     = mSComboBox;
     categoryManagerImpl = new CategoryManagerImpl(addCategory);
 }
示例#24
0
 public AddCompany(MSComboBox comboBox)
 {
     InitializeComponent();
     this.mSComboBox         = comboBox;
     companyManagerControler = new CompanyManagerControler(this, mSComboBox);
 }
示例#25
0
 public AddUnit(MSComboBox comboBox)
 {
     InitializeComponent();
     this.mSComboBox      = comboBox;
     unitManagerControler = new UnitManagerControler(this, mSComboBox);
 }
示例#26
0
 public VendorManagerControler(AddVendor addVendor, MSComboBox mSComboBox)
 {
     this.addVendor    = addVendor;
     this.mSComboBox   = mSComboBox;
     vendorManagerImpl = new VendorManagerImpl(addVendor);
 }
示例#27
0
 public AddBank(MSComboBox mSComboBox)
 {
     InitializeComponent();
     this.mSComboBox      = mSComboBox;
     bankManagerControler = new BankManagerControler(this, mSComboBox);
 }
示例#28
0
 public AddCustomer(MSComboBox comboBox)
 {
     InitializeComponent();
     this.mSComboBox          = comboBox;
     customerManagerControler = new CustomerManagerControler(this, mSComboBox);
 }
示例#29
0
 public AddVendor(MSComboBox mSComboBox)
 {
     InitializeComponent();
     this.mSComboBox        = mSComboBox;
     vendorManagerControler = new VendorManagerControler(this, mSComboBox);
 }