Example #1
0
    public int DeleteSupplierGroup(SupplierGroupListUI supplierGroupListUI)
    {
        int result = 0;

        result = supplierGroupListDAL.DeleteSupplierGroup(supplierGroupListUI);
        return(result);
    }
Example #2
0
    public DataTable GetSupplierGroupListBySearchParameters(SupplierGroupListUI supplierGroupListUI)
    {
        DataTable dtb = new DataTable();

        dtb = supplierGroupListDAL.GetSupplierGroupListBySearchParameters(supplierGroupListUI);
        return(dtb);
    }
Example #3
0
    public DataTable GetSupplierGroupListById(SupplierGroupListUI supplierGroupListUI)
    {
        DataTable dtb = new DataTable();

        dtb = supplierGroupListDAL.GetSupplierGroupListById(supplierGroupListUI);
        return(dtb);
    }
    public void SearchSupplierGroupList()
    {
        try
        {
            SupplierGroupListUI supplierGroupListUI = new SupplierGroupListUI();
            supplierGroupListUI.Search = txtCountrySearch.Text;

            DataTable dtb = supplierGroupListBAL.GetSupplierGroupListBySearchParameters(supplierGroupListUI);

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

            log.Error("[Finance_Accounts_Payable_Supplier_Supplier_Master_Creation_SupplierForm : SupplierGroup] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
        }
    }
Example #5
0
    private void BindListBySearchParameters(SupplierGroupListUI supplierGroupListUI)
    {
        try
        {
            DataTable dtb = supplierGroupListBAL.GetSupplierGroupListBySearchParameters(this.supplierGroupListUI);


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

            log.Error("[System_Settings_SupplierGroupList : BindListBySearchParameters] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
        }
    }
Example #6
0
    public DataTable GetSupplierGroupListById(SupplierGroupListUI supplierGroupListUI)
    {
        DataSet   ds   = new DataSet();
        DataTable dtbl = new DataTable();

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

                sqlCmd.Parameters.Add("@tbl_SupplierGroupId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_SupplierGroupId"].Value = supplierGroupListUI.Tbl_SupplierGroupId;

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

            log.Error("[SupplierGroupListDAL : getSupplierGroupListById] An error occured in the processing of Record Id : " + supplierGroupListUI.Tbl_SupplierGroupId + ". Details : [" + exp.ToString() + "]");
        }
        finally
        {
            ds.Dispose();
        }

        return(dtbl);
    }
Example #7
0
    public int DeleteSupplierGroup(SupplierGroupListUI supplierGroupListUI)
    {
        int result = 0;

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

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

                sqlCmd.Parameters.Add("@tbl_SupplierGroupId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_SupplierGroupId"].Value = supplierGroupListUI.Tbl_SupplierGroupId;

                result = sqlCmd.ExecuteNonQuery();

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

            log.Error("[SupplierGroupListDAL : DeleteSupplierGroup] An error occured in the processing of Record Id : " + supplierGroupListUI.Tbl_SupplierGroupId + ". Details : [" + exp.ToString() + "]");
        }

        return(result);
    }