private void LoaddMemoList() { lvMemoList.Items.Clear(); CResult oResult = new CResult(); CSOBO oSoBo = new CSOBO(); oResult = oSoBo.ReadSOFromToDate(dtpFromDate.Value.Date, dtpToDate.Value.Date, currentBranch.CompBrn_Code); if (oResult.IsSuccess = true) { List <CSOMaster> oSoMasterList = oResult.Data as List <CSOMaster>; if (oSoMasterList != null) { int i = 0; foreach (CSOMaster oSoMaste in oSoMasterList) { ListViewItem lvi = new ListViewItem(); lvi.Text = (i + 1).ToString("00"); lvi.SubItems.Add(oSoMaste.SOMstr_Code); lvi.SubItems.Add(oSoMaste.SOMstr_Date.ToString()); lvi.SubItems.Add(oSoMaste.SOMstr_DtailList.SODet_QTY.ToString()); lvi.SubItems.Add(oSoMaste.SOMstr_NetAmt.ToString()); lvi.Tag = oSoMaste; lvMemoList.Items.Add(lvi); i++; } } else if (oSoMasterList == null) { MessageBox.Show("You have no memo to reprint in the given date", "ETLPOS", MessageBoxButtons.OK, MessageBoxIcon.Information); } } }