Ejemplo n.º 1
0
    public int DeleteComments(CommentsListUI commentsListUI)
    {
        int result = 0;

        result = commentsListDAL.DeleteComments(commentsListUI);
        return(result);
    }
Ejemplo n.º 2
0
    public DataTable GetCommentsListBySearchParameters(CommentsListUI commentsListUI)
    {
        DataTable dtb = new DataTable();

        dtb = commentsListDAL.GetCommentsListBySearchParameters(commentsListUI);
        return(dtb);
    }
Ejemplo n.º 3
0
    public DataTable GetCommentsListById(CommentsListUI commentsListUI)
    {
        DataTable dtb = new DataTable();

        dtb = commentsListDAL.GetCommentsListById(commentsListUI);
        return(dtb);
    }
Ejemplo n.º 4
0
    private void SearchCommentsList()
    {
        try
        {
            CommentsListUI commentsListUI = new CommentsListUI();
            commentsListUI.Search = txtCommentsSearch.Text;
            DataTable dtb = commentsListBAL.GetCommentsListBySearchParameters(commentsListUI);

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

            log.Error("[Finance_Accounts_Payable_PO_POForm : SearchCommentsList] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
        }
    }
Ejemplo n.º 5
0
 private void BindListBySearchParameters(CommentsListUI commentsListUI)
 {
     try
     {
         DataTable dtb = commentsListBAL.GetCommentsListBySearchParameters(this.commentsListUI);
         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     = "Asset_CommentsList.CS";
         logExcpUIobj.RecordId         = "All";
         logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
         logExcpDALobj.SaveExceptionToDB(logExcpUIobj);
         log.Error("[Asset_CommentsList : BindListBySearchParameters] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
     }
 }
Ejemplo n.º 6
0
    public DataTable GetCommentsListById(CommentsListUI commentsListUI)
    {
        DataSet   ds   = new DataSet();
        DataTable dtbl = new DataTable();

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

                sqlCmd.Parameters.Add("@tbl_CommentsId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_CommentsId"].Value = commentsListUI.Tbl_CommentsId;

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

            log.Error("[CommentsListDAL : getCommentsListById] An error occured in the processing of Record Id : " + commentsListUI.Tbl_CommentsId + ". Details : [" + exp.ToString() + "]");
        }
        finally
        {
            ds.Dispose();
        }

        return(dtbl);
    }
Ejemplo n.º 7
0
    public int DeleteComments(CommentsListUI commentsListUI)
    {
        int result = 0;

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

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

                sqlCmd.Parameters.Add("@tbl_CommentsId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_CommentsId"].Value = commentsListUI.Tbl_CommentsId;

                result = sqlCmd.ExecuteNonQuery();

                sqlCmd.Dispose();
                SupportCon.Close();
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "DeleteComments()";
            logExcpUIobj.ResourceName     = "CommentsListDAL.CS";
            logExcpUIobj.RecordId         = commentsListUI.Tbl_CommentsId;
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

            log.Error("[CommentsListDAL : DeleteComments] An error occured in the processing of Record Id : " + commentsListUI.Tbl_CommentsId + ". Details : [" + exp.ToString() + "]");
        }

        return(result);
    }