Esempio n. 1
0
    private void SearchCustomerList()
    {
        try
        {
            PaymentFromCustomerListUI paymentFromCustomerListUI = new PaymentFromCustomerListUI();
            CustomerListUI            customerListUI            = new CustomerListUI();
            customerListUI.Search = txtCustomerSearch.Text;
            DataTable dtb = paymentFromCustomerListBAL.GetPaymentFromCustomerListById(paymentFromCustomerListUI);


            if (dtb.Rows.Count > 0 && dtb != null)
            {
                gvCustomerSearch.DataSource = dtb;
                gvCustomerSearch.DataBind();
                divCustomerSearchError.Visible = false;
            }
            else
            {
                divCustomerSearchError.Visible = true;
                lblCustomerSearchError.Text    = Resources.GlobalResource.msgNoRecordFound;
                gvCustomerSearch.Visible       = false;
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "SearchCustomer()";
            logExcpUIobj.ResourceName     = "Finance_Bank_Accounting_Customer_Receipts_PaymentFromCustomerDistributionForm.CS";
            logExcpUIobj.RecordId         = "All";
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

            log.Error("[Finance_Bank_Accounting_Customer_Receipts_PaymentFromCustomerDistributionForm : SearchCustomer] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
        }
    }
    public int DeleteCustomer(CustomerListUI customerListUI)
    {
        int result = 0;

        result = customerListDAL.DeleteCustomer(customerListUI);
        return(result);
    }
Esempio n. 3
0
    private void SearchCustomerList()
    {
        try
        {
            CustomerListUI customerListUI = new CustomerListUI();
            customerListUI.Search = txtCustomerSearch.Text;
            DataTable dtb = customerListBAL.GetCustomerListBySearchParameters(customerListUI);


            if (dtb.Rows.Count > 0 && dtb != null)
            {
                gvCustomerSearch.DataSource = dtb;
                gvCustomerSearch.DataBind();
                divCustomerSearchError.Visible = false;
            }
            else
            {
                divCustomerSearchError.Visible = true;
                lblCustomerSearchError.Text    = Resources.GlobalResource.msgNoRecordFound;
                gvCustomerSearch.Visible       = false;
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "SearchCustomer()";
            logExcpUIobj.ResourceName     = "System_Settings_CurrencyList.CS";
            logExcpUIobj.RecordId         = "All";
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

            log.Error("[System_Settings_CurrencyList : SearchCustomer] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
        }
    }
    public DataTable GetCustomerListBySearchParameters(CustomerListUI customerListUI)
    {
        DataTable dtb = new DataTable();

        dtb = customerListDAL.GetCustomerListBySearchParameters(customerListUI);
        return(dtb);
    }
    public DataTable GetCustomerListById(CustomerListUI customerListUI)
    {
        DataTable dtb = new DataTable();

        dtb = customerListDAL.GetCustomerListById(customerListUI);
        return(dtb);
    }
    private void BindListBySearchParameters(CustomerListUI customerListUI)
    {
        try
        {
            DataTable dtb = customerListBAL.GetCustomerListBySearchParameters(this.customerListUI);


            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_Accounts_Payable_Customer_Supplier_Master_Creation_CustomerList.CS";
            logExcpUIobj.RecordId         = "All";
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

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

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

                sqlCmd.Parameters.Add("@tbl_CustomerId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_CustomerId"].Value = customerListUI.Tbl_CustomerId;

                using (SqlDataAdapter adapter = new SqlDataAdapter(sqlCmd))
                {
                    adapter.Fill(ds);
                }
            }
            if (ds.Tables.Count > 0)
            {
                dtbl = ds.Tables[0];
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "getCustomerListById()";
            logExcpUIobj.ResourceName     = "CustomerListDAL.CS";
            logExcpUIobj.RecordId         = customerListUI.Tbl_CustomerId;
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

            log.Error("[CustomerListDAL : getCustomerListById] An error occured in the processing of Record Id : " + customerListUI.Tbl_CustomerId + ". Details : [" + exp.ToString() + "]");
        }
        finally
        {
            ds.Dispose();
        }

        return(dtbl);
    }
    public int DeleteCustomer(CustomerListUI customerListUI)
    {
        int result = 0;

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

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

                sqlCmd.Parameters.Add("@tbl_CustomerId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_CustomerId"].Value = customerListUI.Tbl_CustomerId;

                result = sqlCmd.ExecuteNonQuery();

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

            log.Error("[CustomerListDAL : DeleteCustomer] An error occured in the processing of Record Id : " + customerListUI.Tbl_CustomerId + ". Details : [" + exp.ToString() + "]");
        }

        return(result);
    }