public int DeletePaymentFromCustomerDistribution(PaymentFromCustomerDistributionListUI PaymentFromCustomerDistributionListUI)
    {
        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 = PaymentFromCustomerDistributionListUI.Tbl_PaymentFromCustomerDistributionId;

                result = sqlCmd.ExecuteNonQuery();

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

        return(result);
    }
예제 #2
0
    public DataTable GetPaymentFromCustomerDistributionListBySearchParameters(PaymentFromCustomerDistributionListUI PaymentFromCustomerDistributionListUI)
    {
        DataTable dtb = new DataTable();

        dtb = PaymentFromCustomerDistributionListDAL.GetPaymentFromCustomerDistributionListBySearchParameters(PaymentFromCustomerDistributionListUI);
        return(dtb);
    }
예제 #3
0
    public int DeletePaymentFromCustomerDistribution(PaymentFromCustomerDistributionListUI PaymentFromCustomerDistributionListUI)
    {
        int result = 0;

        result = PaymentFromCustomerDistributionListDAL.DeletePaymentFromCustomerDistribution(PaymentFromCustomerDistributionListUI);
        return(result);
    }
    private void BindListBySearchParameters(PaymentFromCustomerDistributionListUI paymentFromCustomerDistributionListUI)
    {
        try
        {
            DataTable dtb = paymentFromCustomerDistributionListBAL.GetPaymentFromCustomerDistributionListBySearchParameters(paymentFromCustomerDistributionListUI);


            if (dtb.Rows.Count > 0 && dtb != null)
            {
                gvData.DataSource = dtb;
                gvData.DataBind();
                divError.Visible = false;
                gvData.Visible   = true;
            }
            else
            {
                divError.Visible = true;
                lblError.Text    = Resources.GlobalResource.msgNoRecordFound;
                gvData.Visible   = false;
            }

            txtSearch.Text = "";
            txtSearch.Focus();
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "BindListBySearchParameters()";
            logExcpUIobj.ResourceName     = "Finance_Bank_Accounting_Customer_Down_Payment_DownPaymentFromCustomerDistributionList.CS";
            logExcpUIobj.RecordId         = "All";
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

            log.Error("[Finance_Bank_Accounting_Customer_Down_Payment_DownPaymentFromCustomerDistributionList : BindListBySearchParameters] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
        }
    }
    public DataTable GetPaymentFromCustomerDistributionListBySearchParameters(PaymentFromCustomerDistributionListUI PaymentFromCustomerDistributionListUI)
    {
        DataSet   ds   = new DataSet();
        DataTable dtbl = new DataTable();

        //Boolean result = false;
        try
        {
            using (SqlConnection SupportCon = new SqlConnection(connectionString))
            {
                SqlCommand sqlCmd = new SqlCommand("SP_PaymentFromCustomerDistribution_SelectBySearchParameters", SupportCon);
                sqlCmd.CommandType    = CommandType.StoredProcedure;
                sqlCmd.CommandTimeout = commandTimeout;

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

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

        return(dtbl);
    }