Exemplo n.º 1
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 = "";
                }
            }
        }
Exemplo n.º 2
0
        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();
                }
            }
        }