private void barButtonItem2_ItemClick(object sender, ItemClickEventArgs e) { if (dxValidationProvider1.Validate()) { expencesObj.ExpencesTypeId = Convert.ToInt32(lookUpExpencesType.EditValue); expencesObj.ExpencesValue = TxtExpencesValue.Value; expencesObj.ExpencesDate = DateTime.Now; expencesObj.Notes = TxtNotes.Text; safeObj.CurrentValue = TxtExpencesValue.Value; if (!AlexLabBL.MainClass.CheckSafeIsClose()) { if (expencesObj.Save(isEdit)) { safeObj.Save(true); MainForm.MessageSecuseed(); } else { MainForm.MessageError(); } } else { MainForm.MessageErrorSafe(); } gridControl1.DataSource = AlexLabBL.MainClass.getExpences(); } }
private void barButtonItem2_ItemClick(object sender, ItemClickEventArgs e) { if (dxValidationProvider1.Validate()) { courseObj.PaymentTypeId = Convert.ToInt32(lookUpPaymentType.EditValue); courseObj.PaymentDate = DateTime.Now; courseObj.AppointmentId = null; courseObj.ClientWorkSpaceId = null; courseObj.PaymentValue = TxtPaymentValue.Value; courseObj.Notes = TxtNotes.Text; safeObj.CurrentValue = TxtPaymentValue.Value; if (!AlexLabBL.MainClass.CheckSafeIsClose()) { if (courseObj.Save(isEdit)) { safeObj.Save(false); MainForm.MessageSecuseed(); } else { MainForm.MessageError(); } } else { MainForm.MessageErrorSafe(); } gridControl1.DataSource = AlexLabBL.MainClass.getPayment(); } }