Ejemplo n.º 1
0
        void loadGridIntial()
        {
            BusinessObjects.Sales_ReturnBM ss = new Sales_ReturnBM();

            GridLoadedSalesList_Public.Clear();

            GridLoadedSalesList_Public = ss.getSalesReturns(con);


            tblSales.Rows.Clear();
            int i = 0;

            //MessageBox.Show(cObjList.Count.ToString());
            foreach (BusinessObjects.Sales_ReturnBM item in GridLoadedSalesList_Public)
            {
                tblSales.Rows.Add();
                tblSales.Rows[i].Cells[0].Value = item.sales_id.ToString();
                tblSales.Rows[i].Cells[1].Value = item.customer_name;
                tblSales.Rows[i].Cells[2].Value = item.total.ToString();
                tblSales.Rows[i].Cells[3].Value = item.date_time.ToString();

                tblSales.Rows[i].Cells[4].Value = item.paid.ToString();

                tblSales.Rows[i].Cells[5].Value = "View Returns";


                i++;
            }
        }
Ejemplo n.º 2
0
        private void txtProductName_TextChanged(object sender, EventArgs e)
        {
            try
            {
                if (txtProductName.Text == string.Empty)
                {
                    return;
                }

                if (txtProductName.Text.Length > 0)
                {
                    string pname = txtProductName.Text;

                    Sales_ReturnBM sale = new Sales_ReturnBM();

                    List <Sales_ReturnBM> saleList = new List <Sales_ReturnBM>();
                    saleList = sale.getSalesReturnByP_Name(con, pname);

                    loadGrid(saleList);
                }
            }
            catch (Exception ex)
            {
                MetroMessageBox.Show(this, "! System Error. " + ex.Message, "System Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 3
0
        private void cmbECategory_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (checkSelectedIndexChange)
                {
                    Category_BS cat = (Category_BS)cmbECategory.SelectedItem;

                    Sales_ReturnBM sale = new Sales_ReturnBM();

                    List <Sales_ReturnBM> saleList = new List <Sales_ReturnBM>();
                    saleList = sale.getSalesReturnByCatID(con, cat.ID);

                    loadGrid(saleList);

                    checkSelectedIndexChange = false;
                }
                else
                {
                    checkSelectedIndexChange = false;
                }
            }
            catch (Exception ex)
            {
                MetroMessageBox.Show(this, "System Error " + ex.Message, "System Error !", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 4
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            DateTime sDate = Convert.ToDateTime(dateStart.Text);

            DateTime eDate = Convert.ToDateTime(dateEnd.Text);

            List <Sales_ReturnBM> salesList = new List <Sales_ReturnBM>();
            Sales_ReturnBM        sales     = new Sales_ReturnBM();



            salesList = sales.getSalesReturnsByDate(con, sDate, eDate);
            // GridLoadedSalesList_Public = salesList;
            loadGrid(salesList);
        }
Ejemplo n.º 5
0
        void autoComplete()
        {
            try
            {
                txtReceiptNo.AutoCompleteMode     = AutoCompleteMode.Suggest;
                txtReceiptNo.AutoCompleteSource   = AutoCompleteSource.CustomSource;
                txtProductName.AutoCompleteMode   = AutoCompleteMode.Suggest;
                txtProductName.AutoCompleteSource = AutoCompleteSource.CustomSource;

                AutoCompleteStringCollection stringColl  = new AutoCompleteStringCollection();
                AutoCompleteStringCollection stringColl2 = new AutoCompleteStringCollection();

                BusinessObjects.M_Product_BS   p = new M_Product_BS();
                BusinessObjects.Sales_ReturnBM s = new Sales_ReturnBM();

                List <M_Product_BS>   PList = new List <M_Product_BS>();
                List <Sales_ReturnBM> SList = new List <Sales_ReturnBM>();
                PList = p.GetProducts(con);
                SList = s.getSalesReturns(con);

                SalesList_Public = SList;



                foreach (M_Product_BS item in PList)
                {
                    //  stringColl.Add(item.ID.ToString());
                    stringColl.Add(item.name);
                }

                foreach (Sales_ReturnBM item in SList)
                {
                    stringColl2.Add(item.sales_id.ToString());
                }


                txtProductName.AutoCompleteCustomSource = stringColl;
                txtReceiptNo.AutoCompleteCustomSource   = stringColl2;
            }
            catch (Exception ex)
            {
                MetroMessageBox.Show(this, "! System Error . Code 104. " + ex.Message, "System Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 6
0
        private void txtReceiptNo_TextChanged(object sender, EventArgs e)
        {
            try
            {
                if (txtReceiptNo.Text == string.Empty)
                {
                    return;
                }

                if (txtReceiptNo.Text.Length > 0)
                {
                    int sid = Convert.ToInt32(txtReceiptNo.Text);

                    Sales_ReturnBM sale = new Sales_ReturnBM();
                    sale.sales_id = sid;
                    List <Sales_ReturnBM> saleList = new List <Sales_ReturnBM>();
                    sale = sale.getSalesReturnsByID(con, sid);
                    SalesList_Public.Clear();
                    SalesList_Public.Add(sale);
                    tblSales.Rows.Clear();
                    int i = 0;
                    foreach (BusinessObjects.Sales_ReturnBM item in SalesList_Public)
                    {
                        tblSales.Rows.Add();
                        tblSales.Rows[i].Cells[0].Value = item.sales_id.ToString();
                        tblSales.Rows[i].Cells[1].Value = item.customer_name;
                        tblSales.Rows[i].Cells[2].Value = item.total.ToString();
                        tblSales.Rows[i].Cells[3].Value = item.date_time.ToString();

                        tblSales.Rows[i].Cells[4].Value = item.paid.ToString();

                        tblSales.Rows[i].Cells[5].Value = "View Returns";


                        i++;
                    }
                }
            }
            catch (Exception ex)
            {
                MetroMessageBox.Show(this, "! System Error. " + ex.Message, "System Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }