Esempio n. 1
0
        /// <summary>
        /// This method is used for Get Sections
        /// </summary>
        /// <param name="SectionId"></param>
        /// <param name="intUserId"></param>
        /// <returns></returns>
        public List <DCSections> GetSections(int AssessmentTypeId, int intUserId)
        {
            objDatabaseHelper = new DatabaseHelper();
            lstDCSections     = new List <DCSections>();
            objDatabaseHelper.AddParameter("pUserId", intUserId == 0 ? DBNull.Value : (object)intUserId);
            objDatabaseHelper.AddParameter("pAssessmentTypeId", AssessmentTypeId == 0 ? DBNull.Value : (object)AssessmentTypeId);
            DbDataReader reader = objDatabaseHelper.ExecuteReader(BLDBRoutines.SP_GETSECTIONSBYASSESSMENTTYPEID, CommandType.StoredProcedure);

            if (reader.HasRows)
            {
                while (reader.Read())
                {
                    objDCSections                  = new DCSections();
                    objDCSections.SectionId        = reader.IsDBNull(reader.GetOrdinal("SectionId")) ? 0 : reader.GetInt32(reader.GetOrdinal("SectionId"));
                    objDCSections.SectionName      = reader.IsDBNull(reader.GetOrdinal("SectionName")) ? string.Empty : reader.GetString(reader.GetOrdinal("SectionName"));
                    objDCSections.SectionNumber    = reader.IsDBNull(reader.GetOrdinal("SectionNumber")) ? string.Empty : reader.GetString(reader.GetOrdinal("SectionNumber"));
                    objDCSections.Description      = reader.IsDBNull(reader.GetOrdinal("Description")) ? string.Empty : reader.GetString(reader.GetOrdinal("Description"));
                    objDCSections.AssessmentTypeId = reader.IsDBNull(reader.GetOrdinal("AssessmentTypeId")) ? 0 : reader.GetInt32(reader.GetOrdinal("AssessmentTypeId"));
                    objDCSections.Critical         = reader.IsDBNull(reader.GetOrdinal("Critical")) ? string.Empty : reader.GetString(reader.GetOrdinal("Critical"));
                    lstDCSections.Add(objDCSections);
                }
                objDCSections.Code = GetSuccessCode;
            }
            return(lstDCSections);
        }
        public JsonResult QuestionsSortingBySortKey(int QuestionId, int SectionId, string Arrow, string AssessmentTypeId)
        {
            lstDCQuestions = new List <DCQuestions>();
            objBLQuestions = new BLQuestions();
            objDCSections  = new DCSections();
            if (Session["UserLogon"] != null)
            {
                DCUsers objDCUsers = (DCUsers)Session["UserLogon"];
                lstDCQuestions = objBLQuestions.QuestionsSortingBySortKey(QuestionId, SectionId, Arrow, Convert.ToInt32(AssessmentTypeId), objDCUsers.UserId);
            }
            var result = Json(lstDCQuestions, JsonRequestBehavior.AllowGet);

            result.MaxJsonLength = int.MaxValue;
            return(result);
        }
        /// <summary>
        ///This method is used for Get Questions
        /// </summary>
        /// <returns></returns>
        public JsonResult GetQuestionsBySectionId(int SectionId)
        {
            lstDCQuestions = new List <DCQuestions>();
            objBLQuestions = new BLQuestions();
            objDCSections  = new DCSections();
            if (Session["UserLogon"] != null)
            {
                DCUsers objDCUsers = (DCUsers)Session["UserLogon"];
                lstDCQuestions = objBLQuestions.GetQuestionsBySectionId(SectionId, objDCUsers.UserId);
            }
            var result = Json(lstDCQuestions, JsonRequestBehavior.AllowGet);

            result.MaxJsonLength = int.MaxValue;
            return(result);
        }
        /// <summary>
        ///This method is used for Get Questions
        /// </summary>
        /// <returns></returns>
        public JsonResult GetQuestions(string strQuestionID)
        {
            lstDCQuestions = new List <DCQuestions>();
            objBLQuestions = new BLQuestions();
            objDCSections  = new DCSections();
            if (Session["UserLogon"] != null)
            {
                DCUsers objDCUsers = (DCUsers)Session["UserLogon"];
                lstDCQuestions = objBLQuestions.GetQuestions(Convert.ToInt32(strQuestionID));
            }
            var result = Json(lstDCQuestions, JsonRequestBehavior.AllowGet);

            result.MaxJsonLength = int.MaxValue;
            return(result);
        }
Esempio n. 5
0
        /// <summary>
        /// Author : Satish
        /// Description : Add Update Sections this method used to add or update the Sections
        /// Date : 12/10/2016
        /// </summary>
        /// <returns></returns>
        public DataOperationResponse AddUpdateSections(DCSections objDCSections)
        {
            try
            {
                objDatabaseHelper        = new DatabaseHelper();
                objDataOperationResponse = new DataOperationResponse();
                objDatabaseHelper.AddParameter("pSectionId", objDCSections.SectionId == 0 ? DBNull.Value : (object)objDCSections.SectionId);
                objDatabaseHelper.AddParameter("pSectionName", objDCSections.SectionName == string.Empty ? DBNull.Value : (object)objDCSections.SectionName);
                objDatabaseHelper.AddParameter("pUserId", objDCSections.CreatedBy == 0 ? DBNull.Value : (object)objDCSections.CreatedBy);
                objDatabaseHelper.AddParameter("pSectionNumber", objDCSections.SectionNumber == string.Empty ? DBNull.Value : (object)objDCSections.SectionNumber);
                objDatabaseHelper.AddParameter("pAssessmentTypeId", objDCSections.AssessmentTypeId == 0 ? DBNull.Value : (object)objDCSections.AssessmentTypeId);
                objDatabaseHelper.AddParameter("pDescription", objDCSections.Description == string.Empty ? DBNull.Value : (object)objDCSections.Description);
                objDatabaseHelper.AddParameter("pCritical", objDCSections.Critical == string.Empty ? DBNull.Value : (object)objDCSections.Critical);
                objDatabaseHelper.AddParameter("oRegisterMessage", string.Empty, ParameterDirection.Output);
                int    result     = objDatabaseHelper.ExecuteNonQuery(BLDBRoutines.SP_ADDUPDATESECTIONS, CommandType.StoredProcedure);
                string strMessage = Convert.ToString(objDatabaseHelper.Command.Parameters["oRegisterMessage"].Value);
                if (result > 0)
                {
                    objDataOperationResponse.Code = GetSuccessCode;
                    if (strMessage == "Maximum critical Count is Six")
                    {
                        objDataOperationResponse.Message = objDCSections.SectionId == 0 ? "Section Added Successfully,Unable to Mark as Critical" : "Section Updated Successfully,Unable to Mark as Critical";
                    }
                    else
                    {
                        objDataOperationResponse.Message = objDCSections.SectionId == 0 ? "Section Added Successfully" : "Section Updated Successfully";
                    }
                }
                else
                {
                    objDataOperationResponse.Code    = GetErrorCode;
                    objDataOperationResponse.Message = strMessage;
                }
                return(objDataOperationResponse);
            }
            catch (Exception exce)
            {
                throw exce;
            }

            finally
            {
                if (objDatabaseHelper != null)
                {
                    objDatabaseHelper.Dispose();
                }
            }
        }
        /// <summary>
        /// This method is used for Add Update Sections
        /// </summary>
        /// <param name="strSectionName"></param>
        /// <param name="hdnSectionId"></param>
        /// <param name="strSectionNumber"></param>
        /// <returns></returns>
        public string AddUpdateSections(string strSectionName, string hdnSectionId, string strSectionNumber, string strAssessmentType, string strDescription, string strCritical)
        {
            objBLSections = new BLSections();
            objDCSections = new DCSections();

            if (Session["UserLogon"] != null)
            {
                DCUsers objDCUsers = (DCUsers)Session["UserLogon"];
                objDCSections.SectionName      = strSectionName;
                objDCSections.CreatedBy        = objDCUsers.UserId;
                objDCSections.SectionNumber    = strSectionNumber;
                objDCSections.AssessmentTypeId = Convert.ToInt32(strAssessmentType);
                objDCSections.SectionId        = string.IsNullOrEmpty(hdnSectionId) ? 0 : Convert.ToInt32(hdnSectionId);
                objDCSections.Description      = strDescription;
                objDCSections.Critical         = strCritical;
                objDataOperationResponse       = objBLSections.AddUpdateSections(objDCSections);
            }
            return(objDataOperationResponse.Message);
        }
Esempio n. 7
0
        public List <DCSections> SectionSortingBySortkey(int SectionId, string Arrow, int AssessmentTypeId, int UserId)
        {
            objDatabaseHelper = new DatabaseHelper();
            lstDCSections     = new List <DCSections>();
            objDCSections     = new DCSections();
            objDatabaseHelper.AddParameter("pSectionId", SectionId == 0 ? DBNull.Value : (object)SectionId);
            objDatabaseHelper.AddParameter("pUserId", UserId == 0 ? DBNull.Value : (object)UserId);
            objDatabaseHelper.AddParameter("pArrow", Arrow == string.Empty ? DBNull.Value : (object)Arrow);
            objDatabaseHelper.AddParameter("pAssessmentTypeId", AssessmentTypeId == 0 ? DBNull.Value : (object)AssessmentTypeId);
            DbDataReader reader = objDatabaseHelper.ExecuteReader(BLDBRoutines.SP_SECTIONSORTINGBYSORTKEY, CommandType.StoredProcedure);

            if (reader.HasRows)
            {
                objDCSections.Code = GetSuccessCode;
            }
            else
            {
                objDCSections.Code = GetErrorCode;
            }
            lstDCSections.Add(objDCSections);
            return(lstDCSections);
        }
Esempio n. 8
0
        public List <DCSections> GetSDV_Sections(int intUserId, int intAssessmentTypeId, int intSectionId)
        {
            try
            {
                objDatabaseHelper = new DatabaseHelper();
                lstDCSections     = new List <DCSections>();
                objDatabaseHelper.AddParameter("pUserId", intUserId == 0 ? DBNull.Value : (object)intUserId);
                objDatabaseHelper.AddParameter("pAssessmentTypeId", intAssessmentTypeId == 0 ? DBNull.Value : (object)intAssessmentTypeId);
                objDatabaseHelper.AddParameter("pSectionId", intSectionId == 0 ? DBNull.Value : (object)intSectionId);

                DbDataReader reader = objDatabaseHelper.ExecuteReader(BLDBRoutines.SP_GETSDV_SECTIONS, CommandType.StoredProcedure);
                if (reader.HasRows)
                {
                    while (reader.Read())
                    {
                        objDCSections               = new DCSections();
                        objDCSections.SectionId     = reader.IsDBNull(reader.GetOrdinal("SectionId")) ? 0 : reader.GetInt32(reader.GetOrdinal("SectionId"));
                        objDCSections.SectionName   = reader.IsDBNull(reader.GetOrdinal("SectionName")) ? string.Empty : reader.GetString(reader.GetOrdinal("SectionName"));
                        objDCSections.SectionNumber = reader.IsDBNull(reader.GetOrdinal("SectionNumber")) ? string.Empty : reader.GetString(reader.GetOrdinal("SectionNumber"));
                        objDCSections.RefKey        = reader.IsDBNull(reader.GetOrdinal("RefKey")) ? 0 : reader.GetInt32(reader.GetOrdinal("RefKey"));
                        //objDCSections.AssessmentTopic=reader.IsDBNull(reader.GetOrdinal("WAC"))?string.Empty:reader.GetString(reader.GetOrdinal("WAC"));
                        //objDCSections.AssessmentTopicItem = reader.IsDBNull(reader.GetOrdinal("DOCReview")) ? string.Empty : reader.GetString(reader.GetOrdinal("DOCReview"));
                        lstDCSections.Add(objDCSections);
                    }
                }
                return(lstDCSections);
            }
            catch (Exception exec)
            {
                throw exec;
            }
            finally
            {
                if (objDatabaseHelper != null)
                {
                    objDatabaseHelper.Dispose();
                }
            }
        }