Example #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;
        }
    }
Example #2
0
    private void ShowclientSubPaymentsInvoices()
    {
        string paramStr = "";

        if (hfClientID.Value != "")
        {
            paramStr += " AND Client_ID = " + hfClientID.Value;
        }
        if (txtName.Text != "")
        {
            paramStr += " AND ClientInvoicesPaymentsID = " + txtName.Text;
        }
        if (rblActive.SelectedIndex > 0)
        {
            paramStr += " AND Active = " + rblActive.SelectedValue;
        }

        var result   = new ClientSubPaymentsManager().GetClientSubPayments(paramStr);
        var cln_Name = result.FirstOrDefault();

        if (cln_Name != null)
        {
            Client_Name = result.FirstOrDefault().ClientName;
        }

        gvClients.DataSource = result;
        gvClients.DataBind();
    }