コード例 #1
0
        public void ListofCompany()
        {
            // Companay Section Code
            SetupGateway        setupGateway = new SetupGateway();
            List <CompanyModel> companyList  = setupGateway.GetAllCompany();

            if (companyList != null)
            {
                companyGridview.Rows.Clear();
                totalCompanyLabel.Text           = "Total : " + companyList.Count + " Companies Found";
                companyGridview.ColumnCount      = 3;
                companyGridview.Columns[0].Name  = "SL";
                companyGridview.Columns[0].Width = 60;
                companyGridview.Columns[1].Name  = "ID";
                companyGridview.Columns[1].Width = 60;
                companyGridview.Columns[2].Name  = "Company Name";
                companyGridview.Columns[2].Width = 200;
                //   companyGridview.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
                int rn = 0;
                foreach (CompanyModel company in companyList)
                {
                    int inc = companyList.Count;
                    if (inc > rn)
                    {
                        rn++;
                    }
                    companyGridview.Rows.Add(rn, company.Id, company.Name);
                }
            }
        }
コード例 #2
0
        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--";
            }
        }
コード例 #3
0
        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--";
            }
        }
コード例 #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--";
            }
        }
コード例 #5
0
        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--";
            }
        }