private string GetCount(int studyStatusTypeId,int loggedInUserId, int loggedInUserRoleId)
 {
     StringBuilder counts = new StringBuilder();
     int[] dayCounts = { 0, 1, 3, 7, 30 };
     foreach (int dayCount in dayCounts)
     {
         StudyListModal modal = new StudyListModal(0, 0,"","", "", "", 0,studyStatusTypeId,"", "", "", dayCount, loggedInUserRoleId, loggedInUserId,null);
         counts.Append(dayCount);
         counts.Append("=");
         counts.Append(modal.GetRecordCount());
         counts.Append(",");
     }
     counts.Remove(counts.Length - 1, 1);
     return counts.ToString();
 }
 public string GetUserCounts(string loggedInUserName,int loggedInUserId, int loggedInUserRoleId)
 {
     StringBuilder counts = new StringBuilder();
     try
     {
         int[] statusCounts = { 0, 4, 5, 7 };
         foreach (int statusCount in statusCounts)
         {
             StudyListModal modal = new StudyListModal(0, 0, "", "", "", "", 0, statusCount, "", loggedInUserName, "", 30, loggedInUserRoleId, loggedInUserId,null);
             counts.Append(statusCount);
             counts.Append("=");
             counts.Append(modal.GetRecordCount());
             counts.Append(",");
         }
         counts.Remove(counts.Length - 1, 1);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.StackTrace);
     }
     return counts.ToString();
 }
示例#3
0
    private void ExecuteProcedure()
    {
        Nullable<int> clientId = null;
        if (loggedInUserRoleId == Constants.Roles.ClientAdmin || loggedInUserRoleId == Constants.Roles.ClientTechnologist)
        {
            clientId = loggedInUserClientId;
        }
        else if (loggedInUserRoleId == Constants.Roles.Radiologist && ddlClient.SelectedIndex > 0)
        {
            clientId = int.Parse(ddlClient.SelectedValue);
        }
        StudyListModal modal = new StudyListModal(int.Parse(currentPage.Value), int.Parse(sortBy.Value), isAsc.Value, hfPatientId.Value, tbPatientId.Text, tbName.Text, int.Parse(ddlModality.SelectedValue), int.Parse(ddlStatus.SelectedValue), tbProcedure.Text, tbRadiologist.Text, tbPhysician.Text, int.Parse(ddlExamDate.SelectedValue) /*(int)Session["DateFilter"]*/, loggedInUserRoleId, loggedInUserId, clientId/*,loggedInUserHospitalId*/);
        /*
           // if (Session["FromDate"] != null && Session["ToDate"] != null)
           // {
             //modal = new StudyListModal(int.Parse(currentPage.Value), int.Parse(sortBy.Value), isAsc.Value, hfPatientId.Value, tbPatientId.Text, tbName.Text,
             //int.Parse(ddlModality.SelectedValue), int.Parse(ddlStatus.SelectedValue), tbProcedure.Text, tbRadiologist.Text, tbPhysician.Text, (DateTime)Session["FromDate"] , (DateTime)Session["ToDate"], loggedInUserRoleId, loggedInUserId);

           // }
           // else
           // {
        int count = 0;
        int count1 = 0;
        if (cblModality.Items[0].Selected == true)
        {
            modalityText.Text = cblModality.Items[0].Text;
            for (int i = 1; i < cblModality.Items.Count; i++)
            {
                if (cblModality.Items[i].Selected == true)
                    cblModality.Items[i].Selected = false;
            }
        }
        if (cblStatus.Items[0].Selected == true)
        {
            statusText.Text = cblStatus.Items[0].Text;
            for (int i = 1; i < cblStatus.Items.Count; i++)
            {
                if (cblStatus.Items[i].Selected == true)
                    cblStatus.Items[i].Selected = false;
            }
        }
        for (int i = 0; i < cblStatus.Items.Count ; i++)
        {
            if (cblStatus.Items[i].Selected==true)
            {
                count++;
            }
        }
        for (int i = 0;i < cblModality.Items.Count; i++)
        {
            if (cblModality.Items[i].Selected == true)
            {
                count1++;
            }
        }

        int[] StatusIds= new int[count];
        int[] ModalityIds = new int[count1];
        int index = 0;
        int index1=0;
        for(int i = 0; i < cblStatus.Items.Count;i++)
        {
            if (cblStatus.Items[i].Selected==true)
            {
                StatusIds[index] = int.Parse(cblStatus.Items[i].Value.ToString());
                index++;
            }
        }
        for (int i = 0;i < cblModality.Items.Count; i++)
        {
            if (cblModality.Items[i].Selected == true)
            {
                ModalityIds[index1] = int.Parse(cblModality.Items[i].Value.ToString());
                index1++;
            }
        }*/
        //modal =
          //  }
        int totalRecords = modal.GetRecordCount();
        if (totalRecords == 0)
        {
            Session[ParameterNames.Session.ErrorMessage] = Messages.Information.NoRecordsFound;
        }
        else
        {
            BuildTable(modal.GetData(), totalRecords);
        }
    }