public ActionResult AddRCMitigation(FormCollection frmcol)
 {
     if (Session["UserLogon"] != null)
     {
         if (!string.IsNullOrEmpty(frmcol["btnAddMitigation"]))
         {
             DCUsers objDCUsers = (DCUsers)Session["UserLogon"];
             objBLRiskCriteria = new BLRiskCriteria();
             objDCRiskCriteria = new DCRiskCriteria();
             objDCRiskCriteria.RiskCriteria            = frmcol["hdnRiskCriteria"];
             objDCRiskCriteria.RiskCriteriaDescription = frmcol["ddlRiskCriteriaDescription"];
             objDCRiskCriteria.Mitigation = frmcol["txtMitigation"];
             objDataOperationResponse     = objBLRiskCriteria.AddRCMitigation(objDCRiskCriteria);
             if (objDataOperationResponse.Code > 0)
             {
                 TempData["successMessage"] = objDataOperationResponse.Message;
             }
             else
             {
                 TempData["errorMessage"] = objDataOperationResponse.Message;
             }
             TempData["activetab"] = "3";
             // return Redirect("/RiskCriteria/ViewRiskCriteria");
             return(Redirect("/RiskCriteria/AddRCMitigation"));
         }
     }
     return(View());
 }
        public JsonResult GetMitigationByRCDescription(string RiskCriteriaDescription)
        {
            lstDCRiskCriteria = new List <DCRiskCriteria>();
            objBLRiskCriteria = new BLRiskCriteria();
            lstDCRiskCriteria = objBLRiskCriteria.GetMitigationByRCDescription(RiskCriteriaDescription);
            var result = Json(lstDCRiskCriteria, JsonRequestBehavior.AllowGet);

            result.MaxJsonLength = int.MaxValue;
            return(result);
        }
        /// <summary>
        /// Get Risk Criteria Details By Risk Criteria
        /// </summary>
        /// <returns></returns>
        ///

        public JsonResult GetRiskCriteriaDetailsByRiskCriteria(string strRiskCriteria, string strAttribute)
        {
            lstDCRiskCriteria = new List <DCRiskCriteria>();
            objBLRiskCriteria = new BLRiskCriteria();
            lstDCRiskCriteria = objBLRiskCriteria.GetRiskCriteriaDetailsByRiskCriteria(strRiskCriteria, strAttribute);
            var result = Json(lstDCRiskCriteria, JsonRequestBehavior.AllowGet);

            result.MaxJsonLength = int.MaxValue;
            return(result);
        }
        /// <summary>
        /// Get Risk Criteria
        /// </summary>
        /// <returns></returns>
        ///

        public JsonResult GetRiskCriteriaByAttributeType()
        {
            lstDCRiskCriteria = new List <DCRiskCriteria>();
            objBLRiskCriteria = new BLRiskCriteria();
            lstDCRiskCriteria = objBLRiskCriteria.GetRiskCriteriaByAttributeType("RC");
            var result = Json(lstDCRiskCriteria, JsonRequestBehavior.AllowGet);

            result.MaxJsonLength = int.MaxValue;
            return(result);
        }
        public JsonResult GetRCActionItems()
        {
            lstDCRiskCriteria = new List <DCRiskCriteria>();
            objBLRiskCriteria = new BLRiskCriteria();
            lstDCRiskCriteria = objBLRiskCriteria.GetRCActionItems();
            var result = Json(lstDCRiskCriteria, JsonRequestBehavior.AllowGet);

            result.MaxJsonLength = int.MaxValue;
            return(result);
        }
        /// <summary>
        /// Add Risk Criteria
        /// </summary>
        /// <returns></returns>
        ///
        public ActionResult AddRiskCriteria(FormCollection frmColl)
        {
            if (Session["UserLogon"] != null)
            {
                if (!string.IsNullOrEmpty(frmColl["btnAddRiskCriteria"]) || !string.IsNullOrEmpty(frmColl["btnAddAttribute"]))
                {
                    DCUsers objDCUsers = (DCUsers)Session["UserLogon"];
                    objBLRiskCriteria = new BLRiskCriteria();
                    objDCRiskCriteria = new DCRiskCriteria();

                    if (string.IsNullOrEmpty(frmColl["ddlAttribute"]) && string.IsNullOrEmpty(frmColl["ddlRiskCriteria"]))
                    {
                        objDCRiskCriteria.Attribute    = "RC";
                        objDCRiskCriteria.DataValue    = frmColl["txtRiskCriteria"];
                        objDCRiskCriteria.RiskCriteria = frmColl["txtRiskCriteria"];
                    }
                    else
                    {
                        objDCRiskCriteria.Attribute    = frmColl["ddlAttribute"];
                        objDCRiskCriteria.DataValue    = frmColl["txtAttributeDescription"];
                        objDCRiskCriteria.RiskCriteria = frmColl["hdnRiskCriteria"];
                    }
                    objDCRiskCriteria.CreatedBy = objDCUsers.UserId;
                    objDataOperationResponse    = objBLRiskCriteria.AddRiskCriteria(objDCRiskCriteria);
                    if (objDataOperationResponse.Code > 0)
                    {
                        if (string.IsNullOrEmpty(frmColl["ddlAttribute"]) && string.IsNullOrEmpty(frmColl["ddlRiskCriteria"]))
                        {
                            TempData["successMessage"] = "Risk Criteria Added Successfully";
                            TempData["activetab"]      = "1";
                        }
                        else
                        {
                            TempData["successMessage"] = "Risk Criteria Attribute Added Successfully";
                            TempData["activetab"]      = "2";
                        }
                    }
                    else
                    {
                        if (string.IsNullOrEmpty(frmColl["ddlAttribute"]) && string.IsNullOrEmpty(frmColl["ddlRiskCriteria"]))
                        {
                            TempData["errorMessage"] = objDataOperationResponse.Message;
                            TempData["activetab"]    = "1";
                        }
                        else
                        {
                            TempData["errorMessage"] = objDataOperationResponse.Message;
                            TempData["activetab"]    = "2";
                        }
                    }
                }
            }
            return(View());
        }
 public string DeleteRCMitigation(string RCMitigationId)
 {
     objBLRiskCriteria        = new BLRiskCriteria();
     objDataOperationResponse = objBLRiskCriteria.DeleteRCMitigation(Convert.ToInt32(RCMitigationId));
     return(objDataOperationResponse.Message);
 }