Esempio n. 1
0
        public void CatagoriesList()
        {
            catagoryGridview.Rows.Clear();

            SetupGateway         setupGateway = new SetupGateway();
            List <CatagoryModel> catagorylist = setupGateway.GetAllCatagory();

            if (catagorylist != null)
            {
                totalCatagoryLabel.Text           = "TotaL : " + catagorylist.Count + " Categories Found";
                catagoryGridview.ColumnCount      = 3;
                catagoryGridview.Columns[0].Name  = "SL";
                catagoryGridview.Columns[0].Width = 60;
                catagoryGridview.Columns[1].Name  = "ID";
                catagoryGridview.Columns[1].Width = 60;
                catagoryGridview.Columns[2].Name  = "Category Name";
                catagoryGridview.Columns[2].Width = 200;
                //  catagoryGridview.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
                int rn = 0;
                foreach (CatagoryModel catagory in catagorylist)
                {
                    int inc = catagorylist.Count;
                    if (inc > rn)
                    {
                        rn++;
                    }
                    catagoryGridview.Rows.Add(rn, catagory.Id, catagory.Name);
                }
            }
        }
        private void History_Load(object sender, EventArgs e)
        {
            // Hide Something
            startClander.Visible   = false;
            endClander.Visible     = false;
            exportButton.Visible   = false;
            ItemListBox.DataSource = null;
            startDate.Text         = "";
            endDate.Text           = "";
            historyGridView.Rows.Clear();



            // Load Data To catagory and CompanyList
            SetupGateway         setupGateway = new SetupGateway();
            List <CatagoryModel> catagorylist = setupGateway.GetAllCatagory();
            List <CompanyModel>  companyList  = setupGateway.GetAllCompany();

            if (catagorylist != null)
            {
                var catagoryList = catagorylist.Select(x => new
                {
                    Value = x.Id,
                    Text  = x.Name
                }).ToList();
                catagoryListBox.ValueMember   = "Value";
                catagoryListBox.DisplayMember = "Text";
                catagoryListBox.DataSource    = catagoryList;
                catagoryListBox.SelectedValue = 0;
                catagoryListBox.SelectedText  = "--Select Category--";
            }
            else
            {
                catagoryListBox.SelectedValue = 0;
                catagoryListBox.SelectedText  = "--No Categories Found--";
            }
            if (companyList != null)
            {
                var companylist = companyList.Select(x => new
                {
                    Value = x.Id,
                    Text  = x.Name
                }).ToList();
                companyListBox.ValueMember   = "Value";
                companyListBox.DisplayMember = "Text";
                companyListBox.DataSource    = companylist;
                companyListBox.SelectedValue = 0;
                companyListBox.SelectedText  = "--Select Company--";
            }
            else
            {
                companyListBox.SelectedValue = 0;
                companyListBox.SelectedText  = "--No Companies Found--";
            }
        }
        private void ItemSetup_Load(object sender, EventArgs e)
        {
            itemsGridView.Rows.Clear();
            itemNameTextBox.Text  = "";
            itemPriceTextBox.Text = "";
            itemsIdHidden.Text    = "";
            // Load Data To catagory and CompanyList
            SetupGateway         setupGateway = new SetupGateway();
            List <CatagoryModel> catagorylist = setupGateway.GetAllCatagory();
            List <CompanyModel>  companyList  = setupGateway.GetAllCompany();

            if (catagorylist.Count > 0)
            {
                var catagoryList = catagorylist.Select(x => new
                {
                    Value = x.Id,
                    Text  = x.Name
                }).ToList();
                catagoryListBox.ValueMember   = "Value";
                catagoryListBox.DisplayMember = "Text";
                catagoryListBox.DataSource    = catagoryList;
                catagoryListBox.SelectedValue = 0;
                catagoryListBox.SelectedText  = "--Select Category--";
            }
            else
            {
                catagoryListBox.SelectedValue = 0;
                catagoryListBox.Text          = "";
                catagoryListBox.SelectedText  = "--No Category--";
            }
            if (companyList.Count > 0)
            {
                var companylist = companyList.Select(x => new
                {
                    Value = x.Id,
                    Text  = x.Name
                }).ToList();
                companyListBox.ValueMember   = "Value";
                companyListBox.DisplayMember = "Text";
                companyListBox.DataSource    = companylist;
                companyListBox.SelectedValue = 0;
                companyListBox.SelectedText  = "--Select Company--";
            }
            else
            {
                companyListBox.SelectedValue = 0;
                companyListBox.Text          = "";
                companyListBox.SelectedText  = "--No Company--";
            }
        }
Esempio n. 4
0
        public void LoadCatagoryAndCompany()
        {
            // Load Data To catagory and CompanyList
            SetupGateway setupGateway = new SetupGateway();
            List<CatagoryModel> catagorylist = setupGateway.GetAllCatagory();
            List<CompanyModel> companyList = setupGateway.GetAllCompany();

            if (catagorylist.Count > 0)
            {
                var catagoryList = catagorylist.Select(x => new
                {
                    Value = x.Id,
                    Text = x.Name
                }).ToList();
                catagoryListBox.ValueMember = "Value";
                catagoryListBox.DisplayMember = "Text";
                catagoryListBox.DataSource = catagoryList;
                catagoryListBox.SelectedValue = 0;
                catagoryListBox.SelectedText = "--Select Category--";
            }
            else
            {
                catagoryListBox.SelectedValue = 0;
                catagoryListBox.Text = "";
                catagoryListBox.SelectedText = "--No Category--";
            }
            if (companyList.Count > 0)
            {
                var companylist = companyList.Select(x => new
                {
                    Value = x.Id,
                    Text = x.Name
                }).ToList();
                companyListBox.ValueMember = "Value";
                companyListBox.DisplayMember = "Text";
                companyListBox.DataSource = companylist;
                companyListBox.SelectedValue = 0;
                companyListBox.SelectedText = "--Select Company--";
            }
            else
            {
                companyListBox.SelectedValue = 0;
                companyListBox.Text = "";
                companyListBox.SelectedText = "--No Company--";
            }
        }
        private void StockOut_Load(object sender, EventArgs e)
        {
            listofStockOut.Clear();
            stockOutCard.Rows.Clear();

            // Text Box
            catagoryListBox.Enabled        = true;
            companyListBox.Enabled         = true;
            ItemListBox.DataSource         = null;
            ItemListBox.Enabled            = true;
            discountPercentTextBox.Enabled = true;
            discountPriceTexBox.Enabled    = true;
            vatPercentTextBox.Enabled      = true;
            outQuantityTextBox.Enabled     = true;
            stockOutCard.Enabled           = true;
            modelBox.Enabled             = true;
            modelBox.Text                = "N/A";
            priceTextBox.Text            = "";
            outTotalPriceTextBox.Text    = "";
            availAbleQuatityTextBox.Text = "";
            outQuantityTextBox.Text      = "";
            discountPercentTextBox.Text  = "";
            discountPriceTexBox.Text     = "";
            vatPercentTextBox.Text       = "";
            vatPriceTextBox.Text         = "";
            netBillTexBox.Text           = "";
            cardTitle.Text               = "";


            // Customer name and label fileds
            mnumberBox.Visible      = false;
            customerNameBox.Visible = false;
            addressTextBox.Visible  = false;
            nameLabel.Visible       = false;
            addLabel.Visible        = false;
            numberLabel.Visible     = false;
            // Button for actioins
            saleButton.Enabled    = true;
            saleButton.Visible    = false;
            lostButton.Visible    = false;
            damageButton.Visible  = false;
            okButton.Visible      = false;
            cancelButton.Visible  = false;
            addCardButton.Enabled = true;



            // Load Data To catagory and CompanyList
            SetupGateway         setupGateway = new SetupGateway();
            List <CatagoryModel> catagorylist = setupGateway.GetAllCatagory();
            List <CompanyModel>  companyList  = setupGateway.GetAllCompany();

            if (catagorylist.Count > 0)
            {
                var catagoryList = catagorylist.Select(x => new
                {
                    Value = x.Id,
                    Text  = x.Name
                }).ToList();
                catagoryListBox.ValueMember   = "Value";
                catagoryListBox.DisplayMember = "Text";
                catagoryListBox.DataSource    = catagoryList;
                catagoryListBox.SelectedValue = 0;
                catagoryListBox.SelectedText  = "--Select Category--";
            }
            else
            {
                catagoryListBox.SelectedValue = 0;
                catagoryListBox.Text          = "";
                catagoryListBox.SelectedText  = "--No Category Found--";
            }
            if (companyList.Count > 0)
            {
                var companylist = companyList.Select(x => new
                {
                    Value = x.Id,
                    Text  = x.Name
                }).ToList();
                companyListBox.ValueMember   = "Value";
                companyListBox.DisplayMember = "Text";
                companyListBox.DataSource    = companylist;
                companyListBox.SelectedValue = 0;
                companyListBox.SelectedText  = "--Select Company--";
            }
            else
            {
                companyListBox.SelectedValue = 0;
                companyListBox.Text          = "";
                companyListBox.SelectedText  = "--No Company Found--";
            }
        }