Example #1
0
    private void SearchDownPaymentCustList()
    {
        try
        {
            DownPaymentFromCustomerListUI DownPaymentFromCustomerListUI = new DownPaymentFromCustomerListUI();
            downPaymentFromCustomerListUI.Search = txtDownPaymentCustSearch.Text;


            DataTable dtb = downPaymentFromCustomerListBAL.GetDownPaymentFromCustomerListBySearchParameters(downPaymentFromCustomerListUI);

            if (dtb.Rows.Count > 0 && dtb != null)
            {
                gvDownPaymentCustSearch.DataSource = dtb;
                gvDownPaymentCustSearch.DataBind();
                divDownPaymentCustSearchError.Visible = false;
            }
            else
            {
                divDownPaymentCustSearchError.Visible = true;
                lblDownPaymentCustSearchError.Text    = Resources.GlobalResource.msgNoRecordFound;
                gvDownPaymentCustSearch.Visible       = false;
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "SearchDownPaymentCustList()";
            logExcpUIobj.ResourceName     = "Finance_Bank_Accounting_Customer_Down_Payment_Default.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_Default : SearchBatchList] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
        }
    }
    public int DeleteDownPaymentFromCustomer(DownPaymentFromCustomerListUI downPaymentFromCustomerListUI)
    {
        int result = 0;

        result = downPaymentFromCustomerListDAL.DeleteDownPaymentFromCustomer(downPaymentFromCustomerListUI);
        return(result);
    }
    public DataTable GetDownPaymentFromCustomerListBySearchParameters(DownPaymentFromCustomerListUI downPaymentFromCustomerListUI)
    {
        DataTable dtb = new DataTable();

        dtb = downPaymentFromCustomerListDAL.GetDownPaymentFromCustomerListBySearchParameters(downPaymentFromCustomerListUI);
        return(dtb);
    }
    public DataTable GetDownPaymentFromCustomerListById(DownPaymentFromCustomerListUI downPaymentFromCustomerListUI)
    {
        DataTable dtb = new DataTable();

        dtb = downPaymentFromCustomerListDAL.GetDownPaymentFromCustomerListById(downPaymentFromCustomerListUI);
        return(dtb);
    }
    public int DeleteDownPaymentFromCustomer(DownPaymentFromCustomerListUI downPaymentFromCustomerListUI)
    {
        int result = 0;

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

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

                sqlCmd.Parameters.Add("@tbl_DownPaymentFromCustomerId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_DownPaymentFromCustomerId"].Value = downPaymentFromCustomerListUI.Tbl_DownPaymentFromCustomerId;

                result = sqlCmd.ExecuteNonQuery();

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

        return(result);
    }
    public DataTable GetDownPaymentFromCustomerListBySearchParameters(DownPaymentFromCustomerListUI downPaymentFromCustomerListUI)
    {
        DataSet   ds   = new DataSet();
        DataTable dtbl = new DataTable();

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

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

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

        return(dtbl);
    }