Esempio n. 1
0
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            if (Data.RefNo == null)
            {
                MessageBox.Show(Message.PL.Transaction_RefNo_Validation);
            }
            else if (Data.To == null)
            {
                MessageBox.Show(Message.PL.Payment_PayTo_Empty);
            }
            else if (Data.Amount == null)
            {
                MessageBox.Show(Message.PL.Payment_Amount_Empty);
            }

            else if (Data.FindRefNo() == false)
            {
                var rv = Data.Save();

                if (rv == true)
                {
                    MessageBox.Show(Message.PL.Saved_Alert);
                    Data.Clear();
                }
            }
            else
            {
                MessageBox.Show(Message.PL.Transaction_RefNo_ExistValidation, Data.RefNo);
            }
        }
Esempio n. 2
0
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            DiffAmt = Math.Abs(drAmt - crAmt);
            if (data.Id == 0 && !BLL.UserAccount.AllowInsert(Common.Forms.frmJournal))
            {
                MessageBox.Show(string.Format(Message.PL.DenyInsert, FormName));
            }
            else if (data.Id != 0 && !BLL.UserAccount.AllowUpdate(Common.Forms.frmJournal))
            {
                MessageBox.Show(string.Format(Message.PL.DenyUpdate, FormName));
            }
            else if (data.VoucherNo == null)
            {
                MessageBox.Show("Enter Entry No");
            }
            else if (data.JDetails.Count == 0)
            {
                MessageBox.Show("Enter Details");
            }
            else if (DiffAmt != 0)
            {
                MessageBox.Show("Difference between Credit and Debit Should be Zero");
            }
            else if (data.FindEntryNo())
            {
                MessageBox.Show("Entry No Already Exist!..");
            }

            else
            {
                Common.AppLib.WriteLog(string.Format("Journal Save=>Begins=>Id={0}", data.Id));
                var rv = data.Save();
                if (rv == true)
                {
                    Common.AppLib.WriteLog(string.Format("Journal Saved Successfully=>Id={0}", data.Id));
                    MessageBox.Show(Message.PL.Saved_Alert);
                    if (ckxAutoPrint.IsChecked == true)
                    {
                        Print();
                    }
                    data.Clear();
                    lblMsg.Text = "";
                }
            }
        }
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            DiffAmt = Math.Abs(drAmt - crAmt);
            if (data.Id == 0 && !BLL.UserAccount.AllowInsert(FormName))
            {
                MessageBox.Show(string.Format(Message.PL.DenyInsert, FormName));
            }
            else if (data.Id != 0 && !BLL.UserAccount.AllowUpdate(FormName))
            {
                MessageBox.Show(string.Format(Message.PL.DenyUpdate, FormName));
            }
            else if (data.VoucherNo == null)
            {
                MessageBox.Show("Enter Entry No");
            }
            else if (data.JDetails.Count == 0)
            {
                MessageBox.Show("Enter Details");
            }
            else if (DiffAmt != 0)
            {
                MessageBox.Show("Difference between Credit and Debit Should be Zero");
            }
            else if (data.FindEntryNo())
            {
                MessageBox.Show("Entry No Already Exist!..");
            }

            else
            {
                var rv = data.Save();
                if (rv == true)
                {
                    MessageBox.Show(Message.PL.Saved_Alert);
                    if (ckxAutoPrint.IsChecked == true)
                    {
                        Print();
                    }
                    data.Clear();
                }
            }
        }