Exemple #1
0
        public TransactionForm()
        {
            InitializeComponent();
              //  this.AcceptButton = saveTransactionbutton;
            transactionActionlabel.Visible = false;
            List<InventoryCategory> aaList = new List<InventoryCategory>();
            InventoryCategoryBLL aBll = new InventoryCategoryBLL();
            aaList = aBll.GetAllCategory();
            categoryNamecomboBox.DataSource = aaList;
            categoryNamecomboBox.DisplayMember = "CategoryName";
            categoryNamecomboBox.ValueMember = "CategoryId";

            //findout item
            try
            {
                InventoryItemBLL aaBll = new InventoryItemBLL();
                List<InventoryItem> aList = new List<InventoryItem>();
                Int32 category = Convert.ToInt32(categoryNamecomboBox.SelectedValue);
                aList = aaBll.GetItemByCategory(category);
                itemNamecomboBox.DataSource = aList;
                itemNamecomboBox.DisplayMember = "ItemName";
                itemNamecomboBox.ValueMember = "ItemId";
                InventoryItem aItem = new InventoryItem();
                aItem = (InventoryItem)itemNamecomboBox.SelectedItem;
                unittypelabel.Text = aItem.UnitName;
            }
            catch (Exception)
            {

            }

            // This used for package activation
               // BookedTransactionTypecomboboxForBusiness();// when Businees Package is active
            BookedTransactionTypecomboboxForProfessional();// when When Professional Package is active
        }
 private void categoryNameComboBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     InventoryItemBLL aaBll = new InventoryItemBLL();
     List<InventoryItem> aList = new List<InventoryItem>();
     if (Convert.ToInt32(categoryNameComboBox.SelectedIndex) >= 0)
     {
         InventoryCategory category = (InventoryCategory)categoryNameComboBox.SelectedItem;
         aList = aaBll.GetItemByCategory(category.CategoryId);
         rawMaterialsNameComboBox.DataSource = aList;
         rawMaterialsNameComboBox.DisplayMember = "ItemName";
         rawMaterialsNameComboBox.ValueMember = "ItemId";
     }
 }
        public InventoryPurchaseForm()
        {
            InitializeComponent();
              //  this.AcceptButton=savePurchasebutton;
            purchaseActionlabel.Visible = false;
            //Find out category
            List<InventoryCategory> aaList=new List<InventoryCategory>();
            InventoryCategoryBLL aBll=new InventoryCategoryBLL();
            aaList = aBll.GetAllCategory();
            categoryNamecomboBox.DataSource = aaList;
            categoryNamecomboBox.DisplayMember = "CategoryName";
            categoryNamecomboBox.ValueMember = "CategoryId";

            //findout item
            InventoryItemBLL aaBll = new InventoryItemBLL();
            List<InventoryItem> aList = new List<InventoryItem>();
            Int32 category = Convert.ToInt32(categoryNamecomboBox.SelectedValue);
            aList = aaBll.GetItemByCategory(category);
            itemNamecomboBox.DataSource = aList;
            itemNamecomboBox.DisplayMember = "ItemName";
            itemNamecomboBox.ValueMember = "ItemId";

            //find out unit
            //int unitId = aaList[categoryNamecomboBox.SelectedIndex].UnitId;
            //UnitCreateBLL aCreateBll = new UnitCreateBLL();
            //Unit aUnit = new Unit();
            //aUnit = aCreateBll.GetUnitByUnitId(unitId);
            try
            {
                unittypelabel.Text = aList[itemNamecomboBox.SelectedIndex].UnitName;
            }
            catch (Exception)
            {

            }

            //find out supplier
            SupplierBLL aSupplierBll=new SupplierBLL();
            List<Supplier>aSuppliers=new List<Supplier>();
            aSuppliers = aSupplierBll.GetAllSupplier();
            supplierNamecomboBox.DataSource = aSuppliers;
            supplierNamecomboBox.DisplayMember = "Name";
            supplierNamecomboBox.ValueMember = "SupplierId";
            dueOradvancelabel.Text = aSupplierBll.GetDueOrAdvance(aSuppliers,Convert.ToInt32(supplierNamecomboBox.SelectedValue));
            BookedPaymentTypeCombobox();
        }
        private void categoryNamecomboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
            if (Convert.ToInt32(categoryNamecomboBox.SelectedValue) > 0)
            {
                InventoryItemBLL aBll = new InventoryItemBLL();
                List<InventoryItem> aList = new List<InventoryItem>();

                Int32 category = Convert.ToInt32(categoryNamecomboBox.SelectedValue);
                InventoryCategory aInventoryCategory =(InventoryCategory) categoryNamecomboBox.Items[categoryNamecomboBox.SelectedIndex];
                UnitCreateBLL aCreateBll = new UnitCreateBLL();
                //Unit aUnit = new Unit();
                //aUnit = aCreateBll.GetUnitByUnitId(aInventoryCategory.UnitId);
                //unittypelabel.Text = aUnit.UnitName;

                aList = aBll.GetItemByCategory(category);
                itemNamecomboBox.DataSource = aList;
                itemNamecomboBox.DisplayMember = "ItemName";
                itemNamecomboBox.ValueMember = "ItemId";
                if (Convert.ToInt32(itemNamecomboBox.SelectedValue) > 0)
                {
                    InventoryItem aItem = new InventoryItem();
                    aItem = (InventoryItem)itemNamecomboBox.SelectedItem;
                    unittypelabel.Text = aItem.UnitName;
                }
            }

            }
            catch
            {

            }
        }
Exemple #5
0
        private void categoryNamecomboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (Convert.ToInt32(categoryNamecomboBox.SelectedValue) > 0)
                {
                    InventoryItemBLL aBll = new InventoryItemBLL();
                    List<InventoryItem> aList = new List<InventoryItem>();

                    Int32 category = Convert.ToInt32(categoryNamecomboBox.SelectedValue);

                    aList = aBll.GetItemByCategory(category);
                    itemNamecomboBox.DataSource = aList;
                    itemNamecomboBox.DisplayMember = "ItemName";
                    itemNamecomboBox.ValueMember = "ItemId";
                    unittypelabel.Text = aList[itemNamecomboBox.SelectedIndex].UnitName;

                }

            }
            catch
            {

            }
        }