public void ExportCaseNote(string caseNoteId, string clientId = "0", string householdId = "0")
        {
            CaseNoteByClientID caseNoteByClientID = Fingerprints.Common.FactoryInstance.Instance.CreateInstance <CaseNoteByClientID>();


            long _testType = 0;

            caseNoteByClientID.CaseNote = new CaseNote
            {
                CaseNoteid  = long.TryParse(caseNoteId, out _testType) ? caseNoteId : EncryptDecrypt.Decrypt64(caseNoteId),
                ClientId    = long.TryParse(clientId, out _testType) ? clientId : EncryptDecrypt.Decrypt64(clientId),
                HouseHoldId = long.TryParse(householdId, out _testType) ? householdId : EncryptDecrypt.Decrypt64(householdId)
            };


            var staffDetails = Fingerprints.Common.FactoryInstance.Instance.CreateInstance <StaffDetails>();

            caseNoteByClientID = new RosterData(staffDetails).GetCaseNoteByCaseNoteId(caseNoteByClientID);


            MemoryStream memoryStream = new Export().ExportCaseNote(caseNoteByClientID, ReportFormatType.Pdf, null);

            string reportName = "Case_Note_Report_";

            DownloadReport(memoryStream, ReportFormatType.Pdf, reportName);
        }
Exemplo n.º 2
0
        public void RemoveFromRoster(string name)
        {
            RosterData roster = Members.ToList().Find(x => x.Name.EqualsIgnoreCase(name));

            if (roster != null)
            {
                Members.ToList().Remove(roster);
            }
        }
        public ActionResult SaveMentalHealthClient(MentalHealthCaseNote MentalHealthCaseNote)
        {
            bool res = false;

            try
            {
                mHealth = new MentalHealthData();
                MentalHealthDashboard dash = new MentalHealthDashboard();
                dash.ClientList = new List <MentalHealthClientList>();

                // for casenote

                string             name       = "";
                string             casenoteid = "";
                RosterNew.CaseNote _caseNote  = new RosterNew.CaseNote();

                _caseNote.CaseNoteAttachmentList = Fingerprints.Common.FactoryInstance.Instance.CreateInstance <List <RosterNew.Attachment> >();
                var ate  = Request.Files;
                var ate2 = ate.AllKeys;
                for (int i = 0; i < ate2.Length; i++)
                {
                    RosterNew.Attachment aatt = new RosterNew.Attachment();
                    aatt.file = ate[i];
                    if (aatt.file.ContentLength > 0)
                    {
                        _caseNote.CaseNoteAttachmentList.Add(aatt);
                    }
                }


                _caseNote.CenterId = EncryptDecrypt.Decrypt64(MentalHealthCaseNote.CenterId);
                // _caseNote.Classroomid = MentalHealthCaseNote.CaseClassroomId.ToString();
                _caseNote.ClientId      = EncryptDecrypt.Decrypt64(MentalHealthCaseNote.ClientId.ToString());
                _caseNote.CaseNotetags  = MentalHealthCaseNote.Tags.Trim(',');
                _caseNote.CaseNoteTitle = MentalHealthCaseNote.Title;
                _caseNote.CaseNoteDate  = MentalHealthCaseNote.Date;
                _caseNote.Note          = MentalHealthCaseNote.MHcasenote;
                _caseNote.ClientIds     = string.Join(",", MentalHealthCaseNote.ClientIds.ToArray());
                //  _caseNote.ProgramId = EncryptDecrypt.Decrypt64(MentalHealthCaseNote.CaseProgramId);


                casenoteid = new RosterData(staff).SaveCaseNotes(ref name, _caseNote, 2);


                res = mHealth.SaveMentalHealthClient(MentalHealthCaseNote, name);
            }
            catch (Exception ex)
            {
                clsError.WriteException(ex);
            }
            return(RedirectToAction("MentalHealthDashboard"));
        }
Exemplo n.º 4
0
        public void UpdateRoster(PlayerInstance ch)
        {
            RosterData roster = Members.ToList().Find(x => x.Name.EqualsIgnoreCase(ch.Name));

            if (roster != null)
            {
                roster.Level  = ch.Level;
                roster.Kills  = ch.PlayerData.PvEKills;
                roster.Deaths = ch.PlayerData.PvEDeaths;
            }
            else
            {
                AddToRoster(ch.Name, (int)ch.CurrentClass, ch.Level, ch.PlayerData.PvEKills, ch.PlayerData.PvEDeaths);
            }
            //Save();
        }
        public JsonResult GetCaseNoteDetailsByYakkr(string householdid, string clientId, string yakkrId)
        {
            //  InternalRefferalCaseNote caseNote = new InternalRefferalCaseNote();
            CaseNoteByClientID casnote = Fingerprints.Common.FactoryInstance.Instance.CreateInstance <CaseNoteByClientID>();

            try
            {
                var caesNoteID = new YakkrData().GetCaseNoteByYakkr(yakkrId);

                casnote.CaseNote             = new CaseNote();
                casnote.CaseNote.ClientId    = clientId;
                casnote.CaseNote.CaseNoteid  = Convert.ToString(caesNoteID);
                casnote.CaseNote.HouseHoldId = householdid;

                casnote = new RosterData(staff).GetCaseNoteByCaseNoteId(casnote);
            }
            catch (Exception ex)
            {
                clsError.WriteException(ex);
            }
            return(Json(casnote, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 6
0
        public ActionResult ClientGrowthChart(string client = "", int type = 0)
        {
            ViewBag.eClientId = client;
            ViewBag.Type      = type;

            try
            {
                long          cid = 0;
                Clientprofile cp  = new Clientprofile();
                if (!string.IsNullOrEmpty(client))
                {
                    cid = Convert.ToInt64(EncryptDecrypt.Decrypt(client));
                    cp  = new RosterData().GetClientDetails(cid);
                }
                ViewBag.ClientDetail = cp;
            }
            catch (Exception ex)
            {
                clsError.WriteException(ex);
            }

            return(View());
        }
Exemplo n.º 7
0
        private List <RosterData> ProcessDataForTime(int employeeId, DateTime startDate, DateTime endDate, List <TMSRoster> rowData,
                                                     List <TMSShiftJobSite> lstShiftJobSite, List <TMSAttendance> lstAtendance, List <TMSShift> lstShiftCode)
        {
            var result               = new List <RosterData>();
            var lstRosterData        = new List <TMSRosterViewModel>();
            TMSRosterViewModel model = null;

            for (var curDate = startDate; curDate.Date <= endDate; curDate = curDate.AddDays(1))
            {
                if (rowData != null && rowData.Count > 0)
                {
                    for (int i = 0; i < rowData.Count; i++)
                    {
                        if (rowData[i].Date == curDate)
                        {
                            var shiftObj      = lstShiftJobSite.Where(x => x.Id == rowData[i].ShiftId).FirstOrDefault();
                            var attendanceObj = lstAtendance.Where(X => X.Id == rowData[i].AttendanceId).FirstOrDefault();
                            if (shiftObj.ShiftId != 0)
                            {
                                var shiftObjSource = lstShiftCode.Where(x => x.Id == shiftObj.ShiftId).FirstOrDefault();
                                shiftObj.MainCode = shiftObjSource.MainCode;
                            }

                            model = AddNewItemDate(employeeId, curDate.Date, rowData[i], shiftObj, attendanceObj);
                            lstRosterData.Add(model);

                            rowData.Remove(rowData[i]);

                            break;
                        }

                        if (i == rowData.Count - 1)
                        {
                            model = AddNewItemDate(employeeId, curDate.Date, null, null, null);
                            lstRosterData.Add(model);
                        }
                    }
                }
                else
                {
                    model = AddNewItemDate(employeeId, curDate.Date, null, null, null);
                    lstRosterData.Add(model);
                }
            }
            ;

            if (startDate.Month - endDate.Month > 0)
            {
                // push data from startMonth to 12
                for (int i = startDate.Month; i <= 12; i++)
                {
                    var data = new RosterData();
                    data.Month    = i;
                    data.MonthStr = GetMonthName(i).ToUpper();
                    //data.ListRoster = new List<TMSRosterViewModel>();
                    data.ListRoster = lstRosterData.Where(x => x.Month == i).ToList();

                    result.Add(data);
                }

                // push data from 1 to endMonth
                for (int i = 1; i <= endDate.Month; i++)
                {
                    var data = new RosterData();
                    data.Month    = i;
                    data.MonthStr = GetMonthName(i).ToUpper();
                    //data.ListRoster = new List<TMSRosterViewModel>();
                    data.ListRoster = lstRosterData.Where(x => x.Month == i).ToList();

                    result.Add(data);
                }
            }
            else
            {
                // push data for each month
                for (int i = startDate.Month; i <= endDate.Month; i++)
                {
                    var data = new RosterData();
                    data.Month    = i;
                    data.MonthStr = GetMonthName(i).ToUpper();
                    //data.ListRoster = new List<TMSRosterViewModel>();
                    data.ListRoster = lstRosterData.Where(x => x.Month == i).ToList();

                    result.Add(data);
                }
            }



            return(result);
        }
Exemplo n.º 8
0
        public void Load()
        {
            try
            {
                if (!_dbContext.Clans.Any())
                {
                    return;
                }

                foreach (DAL.Models.Clan clan in _dbContext.Clans)
                {
                    var newClan = new ClanData(clan.Id, clan.Name);
                    newClan.Description = clan.Description;
                    newClan.Board       = clan.BoardId;
                    newClan.ClanType    = EnumerationExtensions.GetEnum <ClanTypes>(clan.ClanType);
                    newClan.Motto       = clan.Motto;
                    newClan.Deity       = clan.DeityName;
                    newClan.Badge       = clan.Badge;
                    newClan.RecallRoom  = clan.RecallRoomId;
                    newClan.StoreRoom   = clan.StoreRoomId;

                    var clanStats = clan.Stats;
                    newClan.PvEKills       = clan.Stats.PvE_Kills;
                    newClan.PvEDeaths      = clan.Stats.PvE_Deaths;
                    newClan.IllegalPvPKill = clan.Stats.Illegal_PvP_Kills;
                    newClan.Score          = clan.Stats.Score;
                    newClan.Favour         = clan.Stats.Favour;
                    newClan.Strikes        = clan.Stats.Strikes;
                    newClan.MemberLimit    = clan.Stats.MemberLimit;
                    newClan.Alignment      = clan.Stats.Alignment;

                    var members = new List <RosterData>();
                    foreach (DAL.Models.ClanMember clanMember in clan.Members)
                    {
                        var newMember = new RosterData();
                        newMember.Name   = clanMember.Name;
                        newMember.Joined = clanMember.Joined;
                        newMember.Class  = clanMember.ClassId;
                        newMember.Level  = clanMember.Level;
                        newMember.Kills  = clanMember.Kills;
                        newMember.Deaths = clanMember.Deaths;
                        members.Add(newMember);
                    }
                    newClan.Members = members;

                    newClan.LeaderRank = clan.Ranks.First(x => x.RankType == (int)ClanRanks.Leader).RankName;
                    newClan.Leader     = clan.Members.First(x => x.ClanRank == (int)ClanRanks.Leader).Name;

                    newClan.NumberOneRank = clan.Ranks.First(x => x.RankType == (int)ClanRanks.NumberOne).RankName;
                    var member = clan.Members.FirstOrDefault(x => x.ClanRank == (int)ClanRanks.NumberOne);
                    newClan.NumberOne = member == null ? string.Empty : member.Name;

                    newClan.NumberTwoRank = clan.Ranks.First(x => x.RankType == (int)ClanRanks.NumberTwo).RankName;
                    member            = clan.Members.FirstOrDefault(x => x.ClanRank == (int)ClanRanks.NumberTwo);
                    newClan.NumberTwo = member == null ? string.Empty : member.Name;

                    newClan.ClanObjects = clan.Items.Select(x => x.Id);

                    Add(newClan);
                }

                _logManager.Boot("Loaded {0} Clans", Clans.Count());
            }
            catch (DbException ex)
            {
                _logManager.Error(ex);
                throw;
            }
        }
        // [ValidateInput(false)]
        //public ActionResult InsertOrganizationalissue(int ProblemOn, int? CRColorCode, int QuestionaireID, int CommunityId, int Yakkrid,
        //   string MgNotes, RosterNew.CaseNote CaseNote, List<RosterNew.Attachment> Attachments, RosterNew.ClientUsers TeamIds)
        public ActionResult InsertOrganizationalIssue(ReferalDetails referralDetails, RosterNew.CaseNote caseNote, int yakkrId)
        {
            bool caseNoteResult      = true;
            bool questionnaireResult = false;
            int  caseNoteId          = 0;

            if (referralDetails.ProblemOn == 1)
            {
                string message = "";
                string Name    = "";

                //insert casenote


                if (caseNote != null)
                {
                    if (caseNote.CaseNoteAttachmentList != null)
                    {
                        caseNote.CaseNoteAttachmentList.ForEach(x =>
                        {
                            x.AttachmentFileName = string.IsNullOrEmpty(x.AttachmentFileName) ? "OrganizationalIssue_CaseNoteAttachment" : x.AttachmentFileName;

                            if (!string.IsNullOrEmpty(x.AttachmentJson))
                            {
                                x.AttachmentFileByte = Convert.FromBase64String(x.AttachmentJson);
                            }
                        });
                    }


                    message = new RosterData(staff).SaveCaseNotes(ref Name, caseNote, 2);
                }


                if (message != "1")
                {
                    caseNoteResult = false;
                }


                if (!string.IsNullOrEmpty(Name))
                {
                    caseNoteId = Convert.ToInt32(Name);
                }
            }



            if (caseNoteResult)
            {
                questionnaireResult = new YakkrData().SubmitFeedBack453(4, referralDetails, staff, yakkrId, caseNoteId);

                if (!questionnaireResult)
                {
                    new RosterData(staff).DeleteCaseNote(casenoteid: caseNoteId, appendcid: new int[] { }, deletemain: true, mode: 1);
                }
            }

            //if (ProblemOn == 1)
            //{
            //    StringBuilder _Ids = new StringBuilder();
            //    if (TeamIds.IDS != null)
            //    {
            //        foreach (string str in TeamIds.IDS)
            //        {
            //            _Ids.Append(str + ",");
            //        }
            //        CaseNote.StaffIds = _Ids.ToString().Substring(0, _Ids.Length - 1);
            //    }
            //    CaseNote.CaseNotetags = (CaseNote != null && !string.IsNullOrEmpty(CaseNote.CaseNotetags)) ? CaseNote.CaseNotetags.Substring(0, CaseNote.CaseNotetags.Length - 1) : "";
            //}
            //CaseNote.CaseNoteAttachmentList = Attachments;
            //var result = new YakkrData().SubmitFeedBack453(4, ProblemOn, CRColorCode, CommunityId, QuestionaireID, Yakkrid, MgNotes, CaseNote);


            return(Json(new { result = questionnaireResult }, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 10
0
        //[ValidateInput(false)]
        public ActionResult InsertQuestionnaireForm(Questionaire qsform, RosterNew.CaseNote CaseNote)
        {
            bool caseNoteResult      = true;
            bool questionnaireResult = false;

            if (qsform.AppointmentMaked == 0)
            {
                string message = "";
                string Name    = "";

                //insert casenote

                CaseNote.CaseNoteAttachmentList.ForEach(x =>
                {
                    x.AttachmentFileName = string.IsNullOrEmpty(x.AttachmentFileName) ? "CaseNoteAttachment" : x.AttachmentFileName;

                    if (!string.IsNullOrEmpty(x.AttachmentJson))
                    {
                        x.AttachmentFileByte = Convert.FromBase64String(x.AttachmentJson);
                    }
                });

                message = new RosterData(staff).SaveCaseNotes(ref Name, CaseNote, 2);

                if (message != "1")
                {
                    caseNoteResult = false;
                }


                if (!string.IsNullOrEmpty(Name))
                {
                    qsform.CaseNoteId = Convert.ToInt32(Name);
                }
            }

            if (caseNoteResult)
            {
                questionnaireResult = new YakkrData().InsertQuestionaireForm(qsform, staff);

                if (!questionnaireResult)
                {
                    new RosterData(staff).DeleteCaseNote(casenoteid: Convert.ToInt32(CaseNote.CaseNoteid), appendcid: new int[] { }, deletemain: true, mode: 1);
                }
            }



            ////return View();
            //if (qsform.AppointmentMaked == 0 && qsform.ReceiveAnotherReferral)
            //{

            //    string ID = EncryptDecrypt.Encrypt64(CaseNote.ClientId);
            //    return new RedirectResult("~/Roster/ReferralService?id=" + ID + "&ClientName=" + CaseNote.ClientName + "");
            //}
            //else
            //{
            //    return new RedirectResult("~/Yakkr/YakkrList?YakkrCode=450");
            //}


            return(Json(new { result = questionnaireResult, encClientId = EncryptDecrypt.Encrypt64(CaseNote.ClientId) }, JsonRequestBehavior.AllowGet));
        }