public int DeletePaymentToSupplierDistribution(PaymentToSupplierDistributionFormUI PaymentToSupplierDistributionFormUI)
    {
        int resutl = 0;

        resutl = PaymentToSupplierDistributionFormDAL.DeletePaymentToSupplierDistribution(PaymentToSupplierDistributionFormUI);
        return(resutl);
    }
Example #2
0
    public int DeletePaymentToSupplierDistribution(PaymentToSupplierDistributionFormUI PaymentToSupplierDistributionFormUI)
    {
        int result = 0;

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

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

                sqlCmd.Parameters.Add("@tbl_PaymentToSupplierDistributionId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_PaymentToSupplierDistributionId"].Value = PaymentToSupplierDistributionFormUI.Tbl_PaymentToSupplierDistributionId;

                result = sqlCmd.ExecuteNonQuery();

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

        return(result);
    }
    public DataTable GetPaymentToSupplierDistributionListById(PaymentToSupplierDistributionFormUI PaymentToSupplierDistributionFormUI)
    {
        DataTable dtb = new DataTable();

        dtb = PaymentToSupplierDistributionFormDAL.GetPaymentToSupplierDistributionListById(PaymentToSupplierDistributionFormUI);
        return(dtb);
    }
 public void BindGetPaymentToSupplierDistribution_SelectByPaymentToSupplierId(PaymentToSupplierDistributionFormUI PaymentToSupplierDistributionFormU)
 {
     PaymentToSupplierDistributionFormU.Tbl_PaymentToSupplierId = Request.QueryString["PaymentToSupplierId"];
     DataTable dtb = PaymentToSupplierDistributionFormBAL.GetPaymentToSupplierDistribution_SelectByDownPaymentToSupplierId(PaymentToSupplierDistributionFormU);
     {
         if (dtb.Rows.Count > 0)
         {
             txtPaymentToSupplier.Text     = dtb.Rows[0]["tbl_Supplier"].ToString();
             txtPaymentToSupplierGuid.Text = dtb.Rows[0]["tbl_PaymentToSupplierId"].ToString();
             txtGLAccountID.Text           = dtb.Rows[0]["tbl_GLAccount"].ToString();
             txtSupplier.Text          = dtb.Rows[0]["tbl_SupplierId"].ToString();
             txtSupplier.Text          = dtb.Rows[0]["tbl_Supplier"].ToString();
             txtPaymentNumber.Text     = dtb.Rows[0]["tbl_PaymentToSupplier"].ToString();
             txtOriginatingAmount.Text = dtb.Rows[0]["OriginatingCredit"].ToString();
             txtfunctionalAmount.Text  = dtb.Rows[0]["Credit"].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);
         }
     }
 }
Example #5
0
    public DataTable GetPaymentToSupplierDistributionListById(PaymentToSupplierDistributionFormUI PaymentToSupplierDistributionFormUI)
    {
        DataSet   ds   = new DataSet();
        DataTable dtbl = new DataTable();

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

                sqlCmd.Parameters.Add("@tbl_PaymentToSupplierDistributionId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_PaymentToSupplierDistributionId"].Value = PaymentToSupplierDistributionFormUI.Tbl_PaymentToSupplierDistributionId;

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

        return(dtbl);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        PaymentToSupplierDistributionFormUI PaymentToSupplierDistributionFormUI = new PaymentToSupplierDistributionFormUI();

        if (!Page.IsPostBack)
        {
            if (Request.QueryString["PaymentToSupplierId"] != null)
            {
                PaymentToSupplierDistributionFormUI.Tbl_PaymentToSupplierId = Request.QueryString["PaymentToSupplierId"];
                BindGetPaymentToSupplierDistribution_SelectByPaymentToSupplierId(PaymentToSupplierDistributionFormUI);
                BindTypeDropDownList();

                btnUpdate.Visible = false;
                btnDelete.Visible = false;
            }

            else if (Request.QueryString["PaymentToSupplierDistributionId"] != null)
            {
                PaymentToSupplierDistributionFormUI.Tbl_PaymentToSupplierDistributionId = Request.QueryString["PaymentToSupplierDistributionId"];
                BindTypeDropDownList();
                FillForm(PaymentToSupplierDistributionFormUI);
                btnSave.Visible   = false;
                btnClear.Visible  = false;
                btnUpdate.Visible = true;
                btnDelete.Visible = true;
                divSupllierSpecification.Visible = false;
                lblHeading.Text = "Update Payment To Supplier Distribution";
            }
            else
            {
                btnSave.Visible   = true;
                btnClear.Visible  = true;
                btnUpdate.Visible = false;
                btnDelete.Visible = false;
                lblHeading.Text   = "Add New  Payment To Supplie Distribution";
            }
        }
    }
    private void FillForm(PaymentToSupplierDistributionFormUI PaymentToSupplierDistributionFormUI)
    {
        try
        {
            DataTable dtb = PaymentToSupplierDistributionFormBAL.GetPaymentToSupplierDistributionListById(PaymentToSupplierDistributionFormUI);

            if (dtb.Rows.Count > 0)
            {
                txtPaymentToSupplier.Text     = dtb.Rows[0]["tbl_Supplier"].ToString();
                txtPaymentToSupplierGuid.Text = dtb.Rows[0]["tbl_PaymentToSupplierId"].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_Payment_DownPaymentFromCustomerDistributionForm.CS";
            logExcpUIobj.RecordId         = PaymentToSupplierDistributionFormUI.Tbl_PaymentToSupplierDistributionId;
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

            log.Error("[Finance_Bank_Accounting_Payment_To_Suppliers_PaymentToSupplierDistributionForm : FillForm] An error occured in the processing of Record Id : " + PaymentToSupplierDistributionFormUI.Tbl_PaymentToSupplierDistributionId + ". Details : [" + exp.ToString() + "]");
        }
    }
Example #8
0
    public int AddPaymentToSupplierDistribution(PaymentToSupplierDistributionFormUI PaymentToSupplierDistributionFormUI)
    {
        int result = 0;

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

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

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

                sqlCmd.Parameters.Add("@tbl_PaymentToSupplierId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_PaymentToSupplierId"].Value = PaymentToSupplierDistributionFormUI.Tbl_PaymentToSupplierId;

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

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

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

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

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

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

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

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

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

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

                result = sqlCmd.ExecuteNonQuery();

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

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

        return(result);
    }
    public DataTable GetPaymentToSupplierDistribution_SelectByDownPaymentToSupplierId(PaymentToSupplierDistributionFormUI paymentToSupplierDistributionFormUI)
    {
        DataTable dtb = new DataTable();

        dtb = PaymentToSupplierDistributionFormDAL.GetPaymentToSupplierDistribution_SelectByPaymentToSupplierId(paymentToSupplierDistributionFormUI);
        return(dtb);
    }