Exemple #1
0
        public ActionResult EvaluationPopupSubmit(DashboardModel model)
        {
            string _loggedInUserID = System.Web.HttpContext.Current.Session["UserID"].ToString();

            model.evaluationModel.EvaluatorID = _loggedInUserID;
            if (ModelState.IsValid)
            {
                _evaluationRepo = new EvaluationRepo();
                _repoResponse   = new RepositoryResponse();
                _repoResponse   = _evaluationRepo.AddorUpdateEvaluationData(model.evaluationModel, _loggedInUserID, true);

                _loginRepo = new LoginRepo();
                int _empSOMRole = int.Parse(System.Web.HttpContext.Current.Session["EmpSOMRole"].ToString());
                int count       = _loginRepo.getActionCounts(_loggedInUserID, _empSOMRole);
                HttpContext.Session["NotifyCount"] = count;

                return(Json(new { success = _repoResponse.success, message = _repoResponse.message }));
            }
            else
            {
                List <string> fieldOrder = new List <string>(new string[] {
                    "UserName", "Password"
                })
                                           .Select(f => f.ToLower()).ToList();

                var _message1 = ModelState
                                .Select(m => new { Order = fieldOrder.IndexOf(m.Key.ToLower()), Error = m.Value })
                                .OrderBy(m => m.Order)
                                .SelectMany(m => m.Error.Errors.Select(e => e.ErrorMessage)).ToList();

                _message = string.Join("<br/>", _message1);

                return(Json(new { success = false, message = _message1 }));
            }
        }
Exemple #2
0
        public ActionResult EvaluationPopupValues(string ID)
        {
            long _id = long.Parse(ID);

            _evaluationRepo = new EvaluationRepo();
            _repoResponse   = new RepositoryResponse();
            if (_id > 0)
            {
                _repoResponse = _evaluationRepo.LoadEvaluationDataByID(_id);
            }
            //else
            //{
            //    _repoResponse = _evaluationRepo.LoadEmpNominationDetails(_id, long.Parse(nominationID), empNum);
            //}

            if (_repoResponse.success == true)
            {
                EvaluationModel model = new EvaluationModel();
                model = _repoResponse.Data;
                //return JSon(model);
                return(Json(new { success = _repoResponse.success, message = _repoResponse.message, data = model }));
            }
            else
            {
                EvaluationModel model = new EvaluationModel();
                return(Json(new { success = _repoResponse.success, message = _repoResponse.message, data = model }));
            }
        }
Exemple #3
0
        public JsonResult LoadEvaluationDetailsForGrid(string dept = "", string fromDate = "", string toDate = "")
        {
            string _loggedInUserID = System.Web.HttpContext.Current.Session["UserID"].ToString();

            if (dept == "--Select--")
            {
                dept = "";
            }
            if (fromDate == "--Select--")
            {
                fromDate = "";
            }
            else if (!string.IsNullOrEmpty(fromDate))
            {
                string[] monthYear = fromDate.Split(' ');
                string   month     = monthYear[0].Substring(0, 3);
                string   year      = monthYear[1];
                fromDate = month + "-" + year;
            }

            if (toDate == "--Select--")
            {
                toDate = "";
            }
            else if (!string.IsNullOrEmpty(toDate))
            {
                string[] monthYear = toDate.Split(' ');
                string   month     = monthYear[0].Substring(0, 3);
                string   year      = monthYear[1];
                toDate = month + "-" + year;
            }
            _repoResponse   = new RepositoryResponse();
            _evaluationRepo = new EvaluationRepo();
            _repoResponse   = _evaluationRepo.LoadAllEvaluationData(_loggedInUserID, dept, fromDate, toDate);
            if (_repoResponse.success)
            {
                var _sa = new JsonSerializerSettings();
                return(Json(_repoResponse.Data));
            }
            else
            {
                return(Json(new { success = _repoResponse.success.ToString(), message = _repoResponse.message }));
            }
        }
 public EvaluationService(
     IUnitWork unitWork,
     INotificationRepo repo,
     IGlobalMessageFactory globalMessageFactory,
     IMessageFactory messageFactory,
     IEvaluationRepo repo1,
     MedicalRepEvaluationsHandlers medicalRepHandlers,
     VisitAssertion visitAssertion,
     IVisitInteracting interacting,
     IMapper mapper,
     INotificationTypeRepo notificationTypeRepo
     ) : base(unitWork, repo, globalMessageFactory, messageFactory)
 {
     _unitWork             = unitWork;
     _repo                 = repo1;
     _medicalRepHandlers   = medicalRepHandlers;
     _visitAssertion       = visitAssertion;
     _interacting          = interacting;
     _mapper               = mapper;
     _notificationTypeRepo = notificationTypeRepo;
     _eventBuilder         = new EvaluationEventBuilder(_notificationTypeRepo);
 }
Exemple #5
0
        public ActionResult EvaluationDataExport()
        {
            string _loggedInUserID = System.Web.HttpContext.Current.Session["UserID"].ToString();

            _evaluationRepo = new EvaluationRepo();
            _repoResponse   = new RepositoryResponse();
            _repoResponse   = _evaluationRepo.LoadAllEvaluationData(_loggedInUserID);

            if (_repoResponse.success)
            {
                DataSet ds    = Assistant.ToDataSet(_repoResponse.Data);
                string  path  = HostingEnvironment.MapPath("~/bin/Pdf/");
                string  fName = "SOM_EvaluationDetails_" + DateTime.Now.ToString("yyyyMMdd_HHmmss") + ".xlsx";

                if (Assistant.DatasetToExcelExport(ds, path, fName, 20, "EvaluationDetails")) // 4th parameter is field Count
                {
                    byte[] fileBytes = System.IO.File.ReadAllBytes(path + "" + fName);

                    return(File(fileBytes, System.Net.Mime.MediaTypeNames.Application.Octet, fName));
                }
            }
            return(Json(new { success = _repoResponse.success.ToString(), message = _repoResponse.message }));
        }
 public MedicalRepEvaluationsHandlers(IMedicalRepRepo medicalRepRepo, IEvaluationRepo evaluationRepo)
 {
     _medicalRepRepo = medicalRepRepo;
     _evaluationRepo = evaluationRepo;
 }
 public NotificationRepo(ApplicationContext context, IEvaluationRepo evaluationRepo) : base(context)
 {
     _evaluationRepo = evaluationRepo;
 }