Пример #1
0
 private int AddAdjustGeneralEntry(DataTable aTable)
 {
     try
     {
         if (!ValidateAdjustTable(aTable))
         {
             return -1;
         }
         AdjustInventoryGeneral aAdjustGeneral = new AdjustInventoryGeneral();
         aAdjustGeneral.Number = AdjustInventoryGeneralMgmt.NextBillNumber();
         aAdjustGeneral.TellerID = Convert.ToInt32(UsersMgmt.SelectUserIDByUserName(SharedFunctions.ReturnLoggedUserName()).ToString());
         aAdjustGeneral.Date = DateTime.Now.ToShortDateString();
         aAdjustGeneral.IsChecked = 0;
         if (AdjustInventoryGeneralMgmt.AddAdjustGeneralItem(aAdjustGeneral))
         {
             return aAdjustGeneral.Number;
         }
         else
         {
             return aAdjustGeneral.Number;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("NOT ADDED \n ERROR IN ADJUSTITEMSFRM: FUNCTION:AddAdjustToDataBase {EXCEPTION }" + ex.ToString(), MsgTxt.UnexpectedError, MessageBoxButtons.OK, MessageBoxIcon.Error);
         return -1;
     }
 }
Пример #2
0
 private void Initialize_Adding_Mode()
 {
     AdjustDgView.Rows.Clear();
     SaveAndPrintBtn.Text = "Save";
     ReferenceNumberTxtBox.Text = AdjustInventoryGeneralMgmt.NextBillNumber().ToString();
     AdjDatePicker.Text = DateTime.Today.ToShortDateString();
     ExportAsPdfBtn.Visible = false;
 }