private void BindListBySearchParameters(CustomerGroupListUI customerGroupListUI)
    {
        try
        {
            DataTable dtb = customerGroupListBAL.GetCustomerGroupListBySearchParameters(this.customerGroupListUI);


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

            log.Error("[Finance_Accounts_Receivable_Customer_Master_Creation_CustomerGroupList : BindListBySearchParameters] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
        }
    }
    public void SearchCustomerGroupList()
    {
        try
        {
            CustomerGroupListUI customerGroupListUI = new CustomerGroupListUI();
            customerGroupListUI.Search = txtCountrySearch.Text;

            DataTable dtb = customerGroupListBAL.GetCustomerGroupListBySearchParameters(customerGroupListUI);

            if (dtb.Rows.Count > 0 && dtb != null)
            {
                gvCustomerGroupSearch.DataSource = dtb;
                gvCustomerGroupSearch.DataBind();
                divCustomerGroupSearchError.Visible = false;
            }
            else
            {
                divCustomerGroupSearchError.Visible = true;
                lblCustomerGroupSearchError.Text    = Resources.GlobalResource.msgNoRecordFound;
                gvCustomerGroupSearch.Visible       = false;
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "CustomerGroup()";
            logExcpUIobj.ResourceName     = "Finance_Accounts_Payable_Customer_Supplier_Master_Creation_CustomerForm.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_CustomerForm : CustomerGroup] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
        }
    }
    public int DeleteCustomerGroup(CustomerGroupListUI customerGroupListUI)
    {
        int result = 0;

        result = customerGroupListDAL.DeleteCustomerGroup(customerGroupListUI);
        return(result);
    }
    public DataTable GetCustomerGroupListBySearchParameters(CustomerGroupListUI customerGroupListUI)
    {
        DataTable dtb = new DataTable();

        dtb = customerGroupListDAL.GetCustomerGroupListBySearchParameters(customerGroupListUI);
        return(dtb);
    }
    public DataTable GetCustomerGroupListById(CustomerGroupListUI customerGroupListUI)
    {
        DataTable dtb = new DataTable();

        dtb = customerGroupListDAL.GetCustomerGroupListById(customerGroupListUI);
        return(dtb);
    }
示例#6
0
    public DataTable GetCustomerGroupListById(CustomerGroupListUI customerGroupListUI)
    {
        DataSet   ds   = new DataSet();
        DataTable dtbl = new DataTable();

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

                sqlCmd.Parameters.Add("@tbl_CustomerGroupId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_CustomerGroupId"].Value = customerGroupListUI.Tbl_CustomerGroupId;

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

            log.Error("[CustomerGroupListDAL : getCustomerGroupListById] An error occured in the processing of Record Id : " + customerGroupListUI.Tbl_CustomerGroupId + ". Details : [" + exp.ToString() + "]");
        }
        finally
        {
            ds.Dispose();
        }

        return(dtbl);
    }
示例#7
0
    public int DeleteCustomerGroup(CustomerGroupListUI customerGroupListUI)
    {
        int result = 0;

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

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

                sqlCmd.Parameters.Add("@tbl_CustomerGroupId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_CustomerGroupId"].Value = customerGroupListUI.Tbl_CustomerGroupId;

                result = sqlCmd.ExecuteNonQuery();

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

            log.Error("[CustomerGroupListDAL : DeleteCustomerGroup] An error occured in the processing of Record Id : " + customerGroupListUI.Tbl_CustomerGroupId + ". Details : [" + exp.ToString() + "]");
        }

        return(result);
    }