Esempio n. 1
0
    private void SaveSubPayment()
    {
        ClientInvoicesPayment item = new ClientInvoicesPayment();

        item.CarInvoice_ID               = Convert.ToInt64(ddlClientInvoices.SelectedValue);
        item.ClientPayments_ID           = Convert.ToInt64(ddlPaymentReceipt.SelectedValue);
        item.ClientInvoicesPaymentsValue = Convert.ToDecimal(txtAmount.Text);
        item.RegisterDate = DateTime.Now;

        var result = new ClientSubPaymentsManager().SaveClientInvoicesPayment(item);

        if (result != null)
        {
            if (result.DifferInvoices >= 0 && result.DifferReceipt >= 0)
            { // Data saved successfully.
                // Refresh all lists in this page after saving data.
                if (hfClientID.Value != "")
                {
                    RefreshAllData(Convert.ToInt64(hfClientID.Value));
                }
                else
                {
                    Server.TransferRequest(Request.Url.AbsolutePath);
                }
            }
            else
            {
                lblError.Text = Resources.AdminResources_en.ValidateAmount; // data no saved becouse validated amount not aproved.
            }
        }
        else
        {
            lblError.Text = Resources.AdminResources_en.ErrorSave;
        }
    }
Esempio n. 2
0
 public ClientSubPayments_AddEditResult SaveClientInvoicesPayment(ClientInvoicesPayment item)
 {
     return(ctxWrite.ClientSubPayments_AddEdit(item.ClientInvoicesPaymentsID, item.ClientPayments_ID, item.CarInvoice_ID, item.ClientInvoicesPaymentsValue,
                                               item.RegisterDate, item.Notes, item.System_Who_Add, item.System_LastAction_IP).FirstOrDefault());
 }