Beispiel #1
0
        public ActionResult SaveData(CaseLogViewModel model)
        {
            JavaScriptSerializer            js           = new JavaScriptSerializer();
            List <CaseLogCommentViewModel>  listComment  = js.Deserialize <List <CaseLogCommentViewModel> >(model.CommentListString);
            List <CaseLogDocumentViewModel> listDocument = js.Deserialize <List <CaseLogDocumentViewModel> >(model.DocumentListString);

            _adminCaseLogMethod.SaveEmployeeCaseData(model.Id, model.StatusId, model.EmployeeId, model.CategoryId, model.Summary, listComment, listDocument, SessionProxy.UserId);

            List <CaseLogViewModel> newModel = modelList(model.EmployeeId);

            return(PartialView("_partialCasesList", newModel));
        }
Beispiel #2
0
        public List <CaseLogViewModel> modelList(int EmployeeId)
        {
            List <CaseLogViewModel> model = new List <CaseLogViewModel>();
            var listData = _adminCaseLogMethod.getActiveList().Where(x => x.EmployeeID == EmployeeId).ToList();

            foreach (var item in listData)
            {
                CaseLogViewModel m = new CaseLogViewModel();
                m.Id = item.Id;
                var employeeDetail = _employeeMethod.getEmployeeById(item.EmployeeID);
                m.EmployeeName = string.Format("{0} {1} - {2}", employeeDetail.FirstName, employeeDetail.LastName, employeeDetail.SSOID);
                m.Summary      = item.Summary;
                var categoryDetail = _otherSettingMethod.getSystemListValueById(item.Category);
                m.CategoryName = categoryDetail.Value;
                var statusDetail = _otherSettingMethod.getSystemListValueById(item.Status);
                m.Status = statusDetail.Value;
                var createdDetail = _employeeMethod.getEmployeeById(item.UserIDCreatedBy);
                m.CreatedName = string.Format("{0} {1}", createdDetail.FirstName, createdDetail.LastName);
                m.CreatedDate = String.Format("{0:dd-MMM-yyy}", item.CreatedDate);
                model.Add(m);
            }
            return(model);
        }
Beispiel #3
0
        public ActionResult AddEditEmployeeCaseLog(int Id)
        {
            CaseLogViewModel model = new CaseLogViewModel();

            model.Id = Id;

            model.StatusList.Add(new SelectListItem()
            {
                Text = "-- Select Status --", Value = "0"
            });
            foreach (var item in _otherSettingMethod.getAllSystemValueListByKeyName("Case Status List"))
            {
                model.StatusList.Add(new SelectListItem()
                {
                    Text = item.Value, Value = item.Id.ToString()
                });
            }

            model.CategoryList.Add(new SelectListItem()
            {
                Text = "-- Select Category --", Value = "0"
            });
            foreach (var item in _otherSettingMethod.getAllSystemValueListByKeyName("Case Category"))
            {
                model.CategoryList.Add(new SelectListItem()
                {
                    Text = item.Value, Value = item.Id.ToString()
                });
            }

            if (model.Id > 0)
            {
                var caseDetail = _adminCaseLogMethod.getCaseById(Id);
                model.CategoryId  = caseDetail.Category;
                model.StatusId    = caseDetail.Status;
                model.EmployeeId  = caseDetail.EmployeeID;
                model.Summary     = caseDetail.Summary;
                model.CreatedDate = String.Format("{0:dd-MM-yyy}", caseDetail.CreatedDate);
                var createdDetail = _employeeMethod.getEmployeeById(caseDetail.UserIDCreatedBy);
                model.CreatedName = string.Format("{0} {1}", createdDetail.FirstName, createdDetail.LastName);
                var caseComment = _adminCaseLogMethod.getCaseCommentByCaseId(Id);
                foreach (var item in caseComment)
                {
                    CaseLogCommentViewModel commentModel = new CaseLogCommentViewModel();
                    commentModel.Id          = item.Id;
                    commentModel.comment     = item.Description;
                    commentModel.commentBy   = item.CreatedName;
                    commentModel.commentTime = item.CreatedDateTime;
                    model.CommentList.Add(commentModel);
                }

                var caseDoument = _adminCaseLogMethod.getCaseDocumentByCaseId(Id);
                foreach (var item in caseDoument)
                {
                    CaseLogDocumentViewModel docModel = new CaseLogDocumentViewModel();
                    docModel.Id           = item.Id;
                    docModel.originalName = item.OriginalName;
                    docModel.newName      = item.NewName;
                    docModel.description  = item.Description;
                    model.DocumentList.Add(docModel);
                }
            }
            return(PartialView("_partialAddEditCases", model));
        }