private void gridLocationRelatedInventory_DoubleClick(object sender, EventArgs e)
        {
            DataRow dr = gridLocationRelatedInventoryView.GetFocusedDataRow();
            if (dr == null)
            {
                XtraMessageBox.Show("You can't update old inventory data ,you can only update new inventory!",
                                    "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

              if (dr != null &&dr["Remarks"].ToString() == "New Entry")
            {
                var edit = new NewInventoryEntry(dr) {Text = "Update Inventory Entry"};
                edit.ShowDialog();

            }
            else
            {
                XtraMessageBox.Show("You can't update old inventory data ,you can only update new inventory!",
                                    "Error",MessageBoxButtons.OK, MessageBoxIcon.Error);

            }
        }
 private void btnInventoryAdd_Click(object sender, EventArgs e)
 {
     if (lkPeriod.EditValue != null && lkInventoryAccount.EditValue != null && lkInventoryStore.EditValue != null)
     {
         NewInventoryEntry inventoryEntry = new NewInventoryEntry(Convert.ToInt32(lkPeriod.EditValue), Convert.ToInt32(lkInventoryStore.EditValue), Convert.ToInt32(lkInventoryAccount.EditValue));
         inventoryEntry.ShowDialog(this);
         btnLoadInventory_Click(null, null);
     }
 }