Exemple #1
0
        public void DisplayData(string transactionID = "-1")
        {
            try
            {
                //Master Data

                BooksTransactionOutMaster objMaster = new BooksTransactionOutMaster();
                objMaster = objMaster.GetTransactionOutMaster(transactionID);

                if (objMaster != null)
                {
                    ClearControl();

                    txtTranID.Text      = objMaster.TransactionID;
                    dtpTranInDate.Value = objMaster.TransactionDate;
                    txtRemarks.Text     = objMaster.Remarks;

                    //Transaction Data
                    BooksTransactionOutDetails        tranDetails = new BooksTransactionOutDetails();
                    List <BooksTransactionOutDetails> list        = new List <BooksTransactionOutDetails>();

                    list = tranDetails.GetTransactionInList(transactionID);

                    if (list.Count > 0)
                    {
                        int i;

                        foreach (BooksTransactionOutDetails obj in list)
                        {
                            i = dgvMain.RowCount;

                            dgvMain.RowCount = i + 1;
                            dgvMain.Rows[i].Cells[SNo].Value = i + 1;

                            dgvMain.Rows[i].Cells[BookID].Value      = obj.BookMaster.BookID;
                            dgvMain.Rows[i].Cells[Subject].Value     = obj.BookMaster.Subject;
                            dgvMain.Rows[i].Cells[Author].Value      = obj.BookMaster.Author;
                            dgvMain.Rows[i].Cells[EditionYear].Value = obj.BookMaster.EditionYear;
                            dgvMain.Rows[i].Cells[EditionNo].Value   = obj.BookMaster.EditionNo;
                            dgvMain.Rows[i].Cells[Unit].Value        = obj.Unit;
                        }
                    }

                    ControlStatus(true);
                }
                else
                {
                    MessageBox.Show("No Record found");
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show(System.Reflection.MethodBase.GetCurrentMethod().Name + "\n" + ex.Message);
            }
        }