private void BindListBySearchParameters(GLAccountBudgetDetailsListUI gLAccountBudgetDetailsListUI)
 {
     try
     {
         DataTable dtb = gLAccountBudgetDetailsListBAL.GetGLAccountBudgetDetailsListBySearchParameters(this.gLAccountBudgetDetailsListUI);
         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_General_Ledger_GL_Integration_GLAccountBudgetDetailsList.CS";
         logExcpUIobj.RecordId         = "All";
         logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
         logExcpDALobj.SaveExceptionToDB(logExcpUIobj);
         log.Error("[Finance_General_Ledger_GL_Integration_GLAccountBudgetDetailsList : BindListBySearchParameters] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
     }
 }
    public int DeleteGLAccountBudgetDetails(GLAccountBudgetDetailsListUI gLAccountBudgetDetailsListUI)
    {
        int result = 0;

        result = gLAccountBudgetDetailsListDAL.DeleteGLAccountBudgetDetails(gLAccountBudgetDetailsListUI);
        return(result);
    }
    public DataTable GetGLAccountBudgetDetailsListBySearchParameters(GLAccountBudgetDetailsListUI gLAccountBudgetDetailsListUI)
    {
        DataTable dtb = new DataTable();

        dtb = gLAccountBudgetDetailsListDAL.GetGLAccountBudgetDetailsListBySearchParameters(gLAccountBudgetDetailsListUI);
        return(dtb);
    }
    public DataTable GetGLAccountBudgetDetailsListById(GLAccountBudgetDetailsListUI gLAccountBudgetDetailsListUI)
    {
        DataTable dtb = new DataTable();

        dtb = gLAccountBudgetDetailsListDAL.GetGLAccountBudgetDetailsListById(gLAccountBudgetDetailsListUI);
        return(dtb);
    }
    public DataTable GetGLAccountBudgetDetailsListBySearchParameters(GLAccountBudgetDetailsListUI gLAccountBudgetDetailsListUI)
    {
        DataSet   ds   = new DataSet();
        DataTable dtbl = new DataTable();

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

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

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

            log.Error("[GLAccountBudgetDetailsListDAL : GetGLAccountBudgetDetailsListBySearchParameters] An error occured in the processing of Record Search = " + gLAccountBudgetDetailsListUI.Search + " . Details : [" + exp.ToString() + "]");
        }
        finally
        {
            ds.Dispose();
        }

        return(dtbl);
    }
    public int DeleteGLAccountBudgetDetails(GLAccountBudgetDetailsListUI gLAccountBudgetDetailsListUI)
    {
        int result = 0;

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

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

                sqlCmd.Parameters.Add("@tbl_GLAccountBudgetDetailsId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_GLAccountBudgetDetailsId"].Value = gLAccountBudgetDetailsListUI.Tbl_GLAccountBudgetDetailsId;

                result = sqlCmd.ExecuteNonQuery();

                sqlCmd.Dispose();
                SupportCon.Close();
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "DeleteGLAccountBudgetDetails()";
            logExcpUIobj.ResourceName     = "GLAccountBudgetDetailsListDAL.CS";
            logExcpUIobj.RecordId         = gLAccountBudgetDetailsListUI.Tbl_GLAccountBudgetDetailsId;
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

            log.Error("[GLAccountBudgetDetailsListDAL : DeleteGLAccountBudgetDetails] An error occured in the processing of Record Id : " + gLAccountBudgetDetailsListUI.Tbl_GLAccountBudgetDetailsId + ". Details : [" + exp.ToString() + "]");
        }

        return(result);
    }