Exemple #1
0
        private void FillListView()
        {
            List <PartyMaster> list    = new List <PartyMaster>();
            PartyMaster        handler = new PartyMaster();

            list = handler.GetPartyMasterList();
            ListViewItem lvi = new ListViewItem();

            if (list != null)
            {
                if (list.Count > 0)
                {
                    foreach (PartyMaster obj in list)
                    {
                        lvi = new ListViewItem(obj.PartyID);
                        lvi.SubItems.Add(obj.PartyName);
                        lvi.SubItems.Add(obj.PersonName);
                        lvi.SubItems.Add(obj.Address);
                        lvi.SubItems.Add(obj.Remarks);
                        lvi.SubItems.Add(obj.ContactNo);
                        lvi.SubItems.Add(obj.Mobile);
                        lvi.SubItems.Add(obj.EamilAddress);
                        lvi.SubItems.Add(obj.Remarks);
                        listView1.Items.Add(lvi);
                    }
                }
            }
        }
Exemple #2
0
        private void FillSearchGrid()
        {
            try
            {
                //
                dgvSearch.RowCount = 0;
                //Master Data
                PartyMaster objMaster = new PartyMaster();

                List <PartyMaster> list = objMaster.GetPartyMasterList();

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

                        foreach (PartyMaster obj in list)
                        {
                            i = dgvSearch.RowCount;

                            dgvSearch.RowCount = i + 1;
                            dgvSearch.Rows[i].Cells[SNoIndex].Value = i + 1;

                            dgvSearch.Rows[i].Cells[PartyIDIndex].Value    = obj.PartyID;
                            dgvSearch.Rows[i].Cells[PartyNameIndex].Value  = obj.PartyName;
                            dgvSearch.Rows[i].Cells[PersonNameIndex].Value = obj.PersonName;
                            dgvSearch.Rows[i].Cells[AddressIndex].Value    = obj.Address;
                            dgvSearch.Rows[i].Cells[ContactNoIndex].Value  = obj.ContactNo;
                            dgvSearch.Rows[i].Cells[MobileIndex].Value     = obj.Mobile;
                            dgvSearch.Rows[i].Cells[EmailIndex].Value      = obj.EamilAddress;
                            dgvSearch.Rows[i].Cells[RemarksIndex].Value    = obj.Remarks;
                        }
                    }
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show(System.Reflection.MethodBase.GetCurrentMethod().Name + "\n" + ex.Message);
            }
        }
        private void FillMainGrid()
        {
            try
            {
                //
                ClearControl();
                //Master Data
                PartyMaster objMaster = new PartyMaster();

                List <PartyMaster> list = objMaster.GetPartyMasterList();

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

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

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

                            dgvMain.Rows[i].Cells[PartyIDIndex].Value    = obj.PartyID;
                            dgvMain.Rows[i].Cells[PartyNameIndex].Value  = obj.PartyName;
                            dgvMain.Rows[i].Cells[PersonNameIndex].Value = obj.PersonName;
                            dgvMain.Rows[i].Cells[AddressIndex].Value    = obj.Address;
                        }
                    }
                }
            }

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