public MedicinePurchaseForm(MedicinePurchase medicine) : base(medicine) { this.mEntry = medicine; this.InitializeComponent(); this.UserInitialize(); }
private void OnAddClick(object sender, EventArgs e) { MedicinePurchase obj = new MedicinePurchase(); if (MedicinePurchaseForm.ShowForm(obj)) { this.LoadListData(obj); } }
public static bool ShowForm(MedicinePurchase obj) { bool r = false; if (!Objectbase.IsNullOrEmpty(obj)) { using (MedicinePurchaseForm frm = new MedicinePurchaseForm(obj)) { r = frm.ShowDialog() == DialogResult.OK; } } return(r); }
private void OnOpenClick(object sender, EventArgs e) { MedicinePurchase obj = this.GetSelected(); if (obj != null) { obj.RefershData(); } if (MedicinePurchaseForm.ShowForm(obj)) { this.LoadListData(obj); } }
private void LoadListData(MedicinePurchase selected) { int count = 0; this.LoadEntityList <MedicinePurchase>(this.dgvData, this.clmCategory.Index, new MedicinePurchaseCollection(tstSearch.Text), selected, delegate(DataGridViewRow row, MedicinePurchase obj) { count++; row.Cells[this.clmCategory.Index].Value = obj.CategoryName; row.Cells[this.clmItem.Index].Value = obj.ItemName; row.Cells[this.clmQuantity.Index].Value = obj.Quantity; row.Cells[this.clmWholesaleRate.Index].Value = obj.WholesaleRate; row.Cells[this.clmAmount.Index].Value = obj.Amount; row.Cells[this.clmExpiryDate.Index].Value = Common.DateToString(obj.ExpiryDate); row.Cells[this.clmMRP.Index].Value = obj.MRP; } ); bool hasRows = count > 0; this.tsbOpen.Enabled = hasRows; }