public int DeleteGLAccountCategory(GLAccountCategoryListUI gLAccountCategoryListUI)
    {
        int result = 0;

        result = gLAccountCategoryListDAL.DeleteGLAccountCategory(gLAccountCategoryListUI);
        return(result);
    }
Esempio n. 2
0
    private void SearchGLAccountCategoryList()
    {
        try
        {
            GLAccountCategoryListBAL gLAccountCategoryListBAL = new GLAccountCategoryListBAL();
            GLAccountCategoryListUI  gLAccountCategoryListUI  = new GLAccountCategoryListUI();

            gLAccountCategoryListUI.Search = txtGLAccountCategorySearch.Text;

            DataTable dtb = gLAccountCategoryListBAL.GetGLAccountCategoryListBySearchParameters(gLAccountCategoryListUI);

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

            log.Error("[Finance_General_Ledger_GL_Integration_GLAccountForm : SearchPaymentTermsList] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
        }
    }
    public DataTable GetGLAccountCategoryListBySearchParameters(GLAccountCategoryListUI gLAccountCategoryListUI)
    {
        DataTable dtb = new DataTable();

        dtb = gLAccountCategoryListDAL.GetGLAccountCategoryListBySearchParameters(gLAccountCategoryListUI);
        return(dtb);
    }
    public DataTable GetGLAccountCategoryListById(GLAccountCategoryListUI gLAccountCategoryListUI)
    {
        DataTable dtb = new DataTable();

        dtb = gLAccountCategoryListDAL.GetGLAccountCategoryListById(gLAccountCategoryListUI);
        return(dtb);
    }
    private void BindListBySearchParameters(GLAccountCategoryListUI gLAccountCategoryListUI)
    {
        try
        {
            DataTable dtb = gLAccountCategoryListBAL.GetGLAccountCategoryListBySearchParameters(this.gLAccountCategoryListUI);


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

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

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

                sqlCmd.Parameters.Add("@tbl_GLAccountCategoryId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_GLAccountCategoryId"].Value = gLAccountCategoryListUI.Tbl_GLAccountCategoryId;

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

            log.Error("[GLAccountCategoryListDAL : getGLAccountCategoryListById] An error occured in the processing of Record Id : " + gLAccountCategoryListUI.Tbl_GLAccountCategoryId + ". Details : [" + exp.ToString() + "]");
        }
        finally
        {
            ds.Dispose();
        }

        return(dtbl);
    }
    public int DeleteGLAccountCategory(GLAccountCategoryListUI gLAccountCategoryListUI)
    {
        int result = 0;

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

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

                sqlCmd.Parameters.Add("@tbl_GLAccountCategoryId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_GLAccountCategoryId"].Value = gLAccountCategoryListUI.Tbl_GLAccountCategoryId;

                result = sqlCmd.ExecuteNonQuery();

                sqlCmd.Dispose();
                SupportCon.Close();
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "DeleteGLAccountCategory()";
            logExcpUIobj.ResourceName     = "GLAccountCategoryListDAL.CS";
            logExcpUIobj.RecordId         = gLAccountCategoryListUI.Tbl_GLAccountCategoryId;
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

            log.Error("[GLAccountCategoryListDAL : DeleteGLAccountCategory] An error occured in the processing of Record Id : " + gLAccountCategoryListUI.Tbl_GLAccountCategoryId + ". Details : [" + exp.ToString() + "]");
        }

        return(result);
    }