Beispiel #1
0
        void AddUpateBank()
        {
            try
            {
                ep1.Clear();

                if (string.IsNullOrEmpty(cmbExpense.Text.Trim()))
                {
                    ep1.SetError(cmbExpense, "Name is Required..");
                    cmbExpense.Focus();
                    return;
                }
                if (string.IsNullOrEmpty(txtAmount.Text.Trim()))
                {
                    ep1.SetError(txtAmount, "Amount is Required..");
                    txtAmount.Focus();
                    return;
                }

                int TM05_EXPENSEID = 0, TM04_BANKID = 0, T009_AMOUNT = 0;
                int.TryParse(cmbExpense.SelectedValue.ToString(), out TM05_EXPENSEID);
                int.TryParse(txtAmount.Text.Trim(), out T009_AMOUNT);

                MyDa = new MyDabaseDataContext(Properties.Settings.Default.Style_King_Dev);
                int?Iout = 0;
                MyDa.USP_VP_ADDUPDATE_EXPENSE_TRANSACTION(Datalayer.iT013_EXPENSETRANSACATIONID, TM05_EXPENSEID, dtpDate.Value, T009_AMOUNT, txtDetails.Text.Trim(), Datalayer.iT001_COMPANYID, ref Iout);
                if (Iout > 0)
                {
                    if (Datalayer.iT013_EXPENSETRANSACATIONID == 0)
                    {
                        Datalayer.InsertMessageBox(sPageName);
                    }
                    else
                    {
                        Datalayer.UpdateMessageBox(sPageName);
                    }
                }
                else
                {
                    if (Datalayer.iT013_EXPENSETRANSACATIONID == 0)
                    {
                        Datalayer.DosenotInsertMessageBox(sPageName);
                    }
                    else
                    {
                        Datalayer.DosenotUpdateMessageBox(sPageName);
                    }
                }

                ResetData();
            }
            catch (Exception ex)
            {
                Datalayer.WorningMessageBox(ex.Message.ToString(), "Error");
            }
        }