public int DeletePaymentFromCustomerDistribution(PaymentFromCustomerDistributionFormUI PaymentFromCustomerDistributionFormUI)
    {
        int resutl = 0;

        resutl = PaymentFromCustomerDistributionFormDAL.DeletePaymentFromCustomerDistribution(PaymentFromCustomerDistributionFormUI);
        return(resutl);
    }
    public DataTable GetPaymentFromCustomerDistributionListById(PaymentFromCustomerDistributionFormUI PaymentFromCustomerDistributionFormUI)
    {
        DataTable dtb = new DataTable();

        dtb = PaymentFromCustomerDistributionFormDAL.GetPaymentFromCustomerDistributionListById(PaymentFromCustomerDistributionFormUI);
        return(dtb);
    }
    public int DeletePaymentFromCustomerDistribution(PaymentFromCustomerDistributionFormUI PaymentFromCustomerDistributionFormUI)
    {
        int result = 0;

        try
        {
            using (SqlConnection SupportCon = new SqlConnection(connectionString))
            {
                SupportCon.Open();
                SqlCommand sqlCmd = new SqlCommand("SP_PaymentFromCustomerDistribution_Delete", SupportCon);

                sqlCmd.CommandType    = CommandType.StoredProcedure;
                sqlCmd.CommandTimeout = commandTimeout;

                sqlCmd.Parameters.Add("@tbl_PaymentFromCustomerDistributionId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_PaymentFromCustomerDistributionId"].Value = PaymentFromCustomerDistributionFormUI.Tbl_PaymentFromCustomerDistributionId;

                result = sqlCmd.ExecuteNonQuery();

                sqlCmd.Dispose();
                SupportCon.Close();
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "DeletePaymentFromCustomerDistribution()";
            logExcpUIobj.ResourceName     = "PaymentFromCustomerDistributionFormDAL.CS";
            logExcpUIobj.RecordId         = PaymentFromCustomerDistributionFormUI.Tbl_PaymentFromCustomerDistributionId;
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);
            log.Error("[PaymentFromCustomerDistributionFormDAL : DeletePaymentFromCustomerDistribution] An error occured in the processing of Record Id : " + PaymentFromCustomerDistributionFormUI.Tbl_PaymentFromCustomerDistributionId + ". Details : [" + exp.ToString() + "]");
        }

        return(result);
    }
    public DataTable GetPaymentFromCustomerDistributionListById(PaymentFromCustomerDistributionFormUI PaymentFromCustomerDistributionFormUI)
    {
        DataSet   ds   = new DataSet();
        DataTable dtbl = new DataTable();

        try
        {
            using (SqlConnection SupportCon = new SqlConnection(connectionString))
            {
                SqlCommand sqlCmd = new SqlCommand("SP_PaymentFromCustomerDistribution_SelectById", SupportCon);
                sqlCmd.CommandType    = CommandType.StoredProcedure;
                sqlCmd.CommandTimeout = commandTimeout;

                sqlCmd.Parameters.Add("@tbl_PaymentFromCustomerDistributionId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_PaymentFromCustomerDistributionId"].Value = PaymentFromCustomerDistributionFormUI.Tbl_PaymentFromCustomerDistributionId;

                using (SqlDataAdapter adapter = new SqlDataAdapter(sqlCmd))
                {
                    adapter.Fill(ds);
                }
            }
            if (ds.Tables.Count > 0)
            {
                dtbl = ds.Tables[0];
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "GetPaymentFromCustomerDistributionListById()";
            logExcpUIobj.ResourceName     = "PaymentFromCustomerDistributionFormDAL.CS";
            logExcpUIobj.RecordId         = PaymentFromCustomerDistributionFormUI.Tbl_PaymentFromCustomerDistributionId;
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);
            log.Error("[PaymentFromCustomerDistributionFormDAL : GetPaymentFromCustomerDistributionListById] An error occured in the processing of Record Id : " + PaymentFromCustomerDistributionFormUI.Tbl_PaymentFromCustomerDistributionId + ". Details : [" + exp.ToString() + "]");
        }
        finally
        {
            ds.Dispose();
        }

        return(dtbl);
    }
Exemplo n.º 5
0
    private void BindPaymentFromDistribution(PaymentFromCustomerDistributionFormUI paymentFromCustomerDistributionFormUI)
    {
        try
        {
            DataTable dtb = paymentFromCustomerDistributionFormBAL.GetPaymentFromCustomerDistribution_SelectByPaymentFromCustomerId(paymentFromCustomerDistributionFormUI);
            {
                if (dtb.Rows.Count > 0)
                {
                    txtCustomer.Text     = dtb.Rows[0]["tbl_Customer"].ToString();
                    txtCustomerGuid.Text = dtb.Rows[0]["tbl_PaymentFromCustomerId"].ToString();
                    //txtCustomerCode.Text = dtb.Rows[0]["CustomerCode"].ToString();
                    txtCustomerName.Text  = dtb.Rows[0]["tbl_Customer"].ToString();
                    txtReceiptnumber.Text = dtb.Rows[0]["tbl_PaymentFromCustomer"].ToString();
                    //txtDocumentNumber.Text = dtb.Rows[0]["DocumentNumber"].ToString();
                    //txtDocumentType.Text = dtb.Rows[0]["DocumentType"].ToString();
                    txtCurrencyName.Text = dtb.Rows[0]["CurrencyName"].ToString();
                    //txtFunctionalAmount.Text = dtb.Rows[0]["TotalAmount"].ToString();
                    //txtOrginatingAmount.Text = dtb.Rows[0]["TotalAmount"].ToString();
                    gvData.DataSource = dtb;
                    gvData.DataBind();
                    divError.Visible = false;
                    gvData.Visible   = true;
                }
                else
                {
                    gvData.Visible = false;
                    this.Page.ClientScript.RegisterStartupScript(this.GetType(), "clearform", "ClearFormAppy();", true);
                }
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "txtDownPaymentcust_TextChanged()";
            logExcpUIobj.ResourceName     = "Finance_Bank_Accounting_Customer_Down_Payment_Default.CS";
            logExcpUIobj.RecordId         = paymentFromCustomerDistributionFormUI.Tbl_PaymentFromCustomerId;
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

            log.Error("[Finance_Bank_Accounting_Customer_Down_Payment_Default : txtDownPaymentcust_TextChanged] An error occured in the processing of Record Details : [" + exp.ToString() + "]");
        }
    }
Exemplo n.º 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        PaymentFromCustomerDistributionFormUI paymentFromCustomerDistributionFormUI = new PaymentFromCustomerDistributionFormUI();

        if (!Page.IsPostBack)
        {
            if (Request.QueryString["PaymentFromCustomerId"] != null)
            {
                paymentFromCustomerDistributionFormUI.Tbl_PaymentFromCustomerId = Request.QueryString["PaymentFromCustomerId"];
                BindPaymentFromDistribution(paymentFromCustomerDistributionFormUI);
                BindTypeDropDownList();
                btnUpdate.Visible = false;
                btnDelete.Visible = false;
            }

            else if (Request.QueryString["PaymentFromCustomerDistributionId"] != null)
            {
                paymentFromCustomerDistributionFormUI.Tbl_PaymentFromCustomerDistributionId = Request.QueryString["PaymentFromCustomerDistributionId"];

                BindTypeDropDownList();
                FillForm(paymentFromCustomerDistributionFormUI);

                btnSave.Visible   = false;
                btnClear.Visible  = false;
                btnUpdate.Visible = true;
                btnDelete.Visible = true;
                lblHeading.Text   = "Update Payment From Customer Distribution";
            }
            else
            {
                BindTypeDropDownList();
                btnSave.Visible   = true;
                btnClear.Visible  = true;
                btnUpdate.Visible = false;
                btnDelete.Visible = false;
                lblHeading.Text   = "Add New Payment From CustomerDistribution";
            }
        }
    }
Exemplo n.º 7
0
    private void FillForm(PaymentFromCustomerDistributionFormUI paymentFromCustomerDistributionFormUI)
    {
        try
        {
            DataTable dtb = paymentFromCustomerDistributionFormBAL.GetPaymentFromCustomerDistributionListById(paymentFromCustomerDistributionFormUI);

            if (dtb.Rows.Count > 0)
            {
                txtCustomer.Text            = dtb.Rows[0]["tbl_Customer"].ToString();
                txtCustomerGuid.Text        = dtb.Rows[0]["tbl_CustomerId"].ToString();
                txtGLAccount.Text           = dtb.Rows[0]["tbl_GLAccount"].ToString();
                txtGLAccountGuid.Text       = dtb.Rows[0]["tbl_GLAccountId"].ToString();
                ddlOptionType.SelectedValue = dtb.Rows[0]["Type"].ToString();
                txtDebit.Text                 = dtb.Rows[0]["Debit"].ToString();
                txtOriginatingDebit.Text      = dtb.Rows[0]["OriginatingDebit"].ToString();
                txtCredit.Text                = dtb.Rows[0]["Credit"].ToString();
                txtOriginatingCredit.Text     = dtb.Rows[0]["OriginatingCredit"].ToString();
                txtDescription.Text           = dtb.Rows[0]["Description"].ToString();
                txtDistributionReference.Text = dtb.Rows[0]["DistributionReference"].ToString();
            }
            else
            {
                lblError.Text    = Resources.GlobalResource.msgCouldNotLoadData;
                divError.Visible = true;
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "FillForm()";
            logExcpUIobj.ResourceName     = "Finance_Bank_Accounting_Customer_Receipts_PaymentFromCustomerDistributionForm.CS";
            logExcpUIobj.RecordId         = paymentFromCustomerDistributionFormUI.Tbl_PaymentFromCustomerDistributionId;
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

            log.Error("[Finance_Bank_Accounting_Customer_Receipts_PaymentFromCustomerDistributionForm : FillForm] An error occured in the processing of Record Id : " + paymentFromCustomerDistributionFormUI.Tbl_PaymentFromCustomerDistributionId + ". Details : [" + exp.ToString() + "]");
        }
    }
    public DataTable GetPaymentFromCustomerDistribution_SelectByPaymentFromCustomerId(PaymentFromCustomerDistributionFormUI paymentFromCustomerDistributionFormUI)
    {
        DataTable dtb = new DataTable();

        dtb = PaymentFromCustomerDistributionFormDAL.GetPaymentFromCustomerDistribution_SelectByPaymentFromCustomerId(paymentFromCustomerDistributionFormUI);
        return(dtb);
    }
    public int AddPaymentFromCustomerDistribution(PaymentFromCustomerDistributionFormUI paymentFromCustomerDistributionFormUI)
    {
        int result = 0;

        try
        {
            using (SqlConnection SupportCon = new SqlConnection(connectionString))
            {
                SupportCon.Open();
                SqlCommand sqlCmd = new SqlCommand("SP_PaymentFromCustomerDistribution_Insert", SupportCon);
                sqlCmd.CommandType    = CommandType.StoredProcedure;
                sqlCmd.CommandTimeout = commandTimeout;

                sqlCmd.Parameters.Add("@CreatedBy", SqlDbType.NVarChar);
                sqlCmd.Parameters["@CreatedBy"].Value = paymentFromCustomerDistributionFormUI.CreatedBy;

                sqlCmd.Parameters.Add("@tbl_OrganizationId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_OrganizationId"].Value = paymentFromCustomerDistributionFormUI.Tbl_OrganizationId;

                sqlCmd.Parameters.Add("@tbl_PaymentFromCustomerId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_PaymentFromCustomerId"].Value = paymentFromCustomerDistributionFormUI.Tbl_PaymentFromCustomerId;

                sqlCmd.Parameters.Add("@tbl_GLAccountId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_GLAccountId"].Value = paymentFromCustomerDistributionFormUI.Tbl_GLAccountId;

                sqlCmd.Parameters.Add("@opt_Type", SqlDbType.Int);
                sqlCmd.Parameters["@opt_Type"].Value = paymentFromCustomerDistributionFormUI.opt_Type;

                sqlCmd.Parameters.Add("@Debit", SqlDbType.Decimal);
                sqlCmd.Parameters["@Debit"].Value = paymentFromCustomerDistributionFormUI.Debit;

                sqlCmd.Parameters.Add("@OriginatingDebit", SqlDbType.Decimal);
                sqlCmd.Parameters["@OriginatingDebit"].Value = paymentFromCustomerDistributionFormUI.OriginatingDebit;

                sqlCmd.Parameters.Add("@Credit", SqlDbType.Decimal);
                sqlCmd.Parameters["@Credit"].Value = paymentFromCustomerDistributionFormUI.Credit;

                sqlCmd.Parameters.Add("@OriginatingCredit", SqlDbType.Decimal);
                sqlCmd.Parameters["@OriginatingCredit"].Value = paymentFromCustomerDistributionFormUI.OriginatingCredit;

                sqlCmd.Parameters.Add("@Description", SqlDbType.NVarChar);
                sqlCmd.Parameters["@Description"].Value = paymentFromCustomerDistributionFormUI.Description;

                sqlCmd.Parameters.Add("@DistributionReference", SqlDbType.NVarChar);
                sqlCmd.Parameters["@DistributionReference"].Value = paymentFromCustomerDistributionFormUI.DistributionReference;

                result = sqlCmd.ExecuteNonQuery();

                sqlCmd.Dispose();
                SupportCon.Close();
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "AddPaymentFromCustomerDistribution()";
            logExcpUIobj.ResourceName     = "PaymentFromCustomerDistributionFormDAL.CS";
            logExcpUIobj.RecordId         = "";
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

            log.Error("[PaymentFromCustomerDistributionFormDAL : AddPaymentFromCustomerDistribution] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
        }

        return(result);
    }