Example #1
0
    private void BindListBySearchParameters(SourceDocumentListUI sourceDocumentListUI)
    {
        try
        {
            DataTable dtb = sourceDocumentListBAL.GetSourceDocumentListBySearchParameters(sourceDocumentListUI);


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

            log.Error("[System_Settings_SourceDocumentList : BindListBySearchParameters] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
        }
    }
    private void SearchSource_DocumentList()
    {
        try
        {
            SourceDocumentListUI sourceDocumentListUI = new SourceDocumentListUI();
            sourceDocumentListUI.Search = txtSource_DocumentSearch.Text;


            DataTable dtb = sourceDocumentListBAL.GetSourceDocumentListBySearchParameters(sourceDocumentListUI);

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

            log.Error("[System_Settings_GLAccountEntryForm : SearchSource_DocumentList] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
        }
    }
Example #3
0
    public int DeleteSourceDocument(SourceDocumentListUI sourceDocumentListUI)
    {
        int result = 0;

        result = sourceDocumentListDAL.DeleteSourceDocument(sourceDocumentListUI);
        return(result);
    }
Example #4
0
    public DataTable GetSourceDocumentListBySearchParameters(SourceDocumentListUI sourceDocumentListUI)
    {
        DataTable dtb = new DataTable();

        dtb = sourceDocumentListDAL.GetSourceDocumentListBySearchParameters(sourceDocumentListUI);
        return(dtb);
    }
Example #5
0
    public DataTable GetSourceDocumentListById(SourceDocumentListUI sourceDocumentListUI)
    {
        DataTable dtb = new DataTable();

        dtb = sourceDocumentListDAL.GetSourceDocumentListById(sourceDocumentListUI);
        return(dtb);
    }
    public DataTable GetSourceDocumentListBySearchParameters(SourceDocumentListUI sourceDocumentListUI)
    {
        DataSet   ds   = new DataSet();
        DataTable dtbl = new DataTable();

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

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

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

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

        return(dtbl);
    }
    public int DeleteSourceDocument(SourceDocumentListUI sourceDocumentListUI)
    {
        int result = 0;

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

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

                sqlCmd.Parameters.Add("@tbl_SourceDocumentId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_SourceDocumentId"].Value = sourceDocumentListUI.Tbl_SourceDocumentId;

                result = sqlCmd.ExecuteNonQuery();

                sqlCmd.Dispose();
                SupportCon.Close();
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "DeleteSourceDocument()";
            logExcpUIobj.ResourceName     = "SourceDocumentListDAL.CS";
            logExcpUIobj.RecordId         = sourceDocumentListUI.Tbl_SourceDocumentId;
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

            log.Error("[SourceDocumentListDAL : DeleteSourceDocument] An error occured in the processing of Record Id : " + sourceDocumentListUI.Tbl_SourceDocumentId + ". Details : [" + exp.ToString() + "]");
        }

        return(result);
    }