Beispiel #1
0
        private void FormPopupDisplay_Load(object sender, EventArgs e)
        {
            textDescription.Text = PopupCur.Description.Replace("\r\n", "\n").Replace("\n", "\r\n");
            if (PopupCur.UserNum != 0)
            {
                textUser.Text = Userods.GetUser(PopupCur.UserNum).UserName;
            }
            textCreateDate.Text = "";
            if (PopupCur.DateTimeEntry.Year > 1880)
            {
                textCreateDate.Text = PopupCur.DateTimeEntry.ToShortDateString() + " " + PopupCur.DateTimeEntry.ToShortTimeString();
            }
            DateTime dateT = Popups.GetLastEditDateTimeForPopup(PopupCur.PopupNum);

            textEditDate.Text = "";
            if (dateT.Year > 1880)
            {
                textEditDate.Text = dateT.ToShortDateString() + " " + dateT.ToShortTimeString();          //Sets the Edit date to the entry date of the last popup change that was archived for this popup.
            }
            for (int i = 1; i <= 4; i++)
            {
                comboMinutes.Items.Add(i.ToString());
            }
            for (int i = 1; i <= 11; i++)
            {
                comboMinutes.Items.Add((i * 5).ToString());
            }
            comboMinutes.Text = "10";
            for (int i = 1; i <= 12; i++)
            {
                comboHours.Items.Add(i.ToString());
            }
            comboHours.Text = "1";
            MinutesDisabled = 0;
        }
Beispiel #2
0
        private void FormPopupDisplay_Load(object sender, EventArgs e)
        {
            //This homogenizes the display because sometimes popups are stored with "\n" and sometimes they are saved with "\r\n"
            textDescription.Text = PopupCur.Description.Replace("\r\n", "\n").Replace("\n", "\r\n");
            if (PopupCur.UserNum != 0)
            {
                //Display last user to edit PopupCur, or "Unknown(5)" if user not found.
                textUser.Text = Userods.GetUser(PopupCur.UserNum)?.UserName ?? (Lan.g(this, "Unknown") + $"({POut.Long(PopupCur.UserNum)})");
            }
            textCreateDate.Text = "";
            if (PopupCur.DateTimeEntry.Year > 1880)
            {
                textCreateDate.Text = PopupCur.DateTimeEntry.ToShortDateString() + " " + PopupCur.DateTimeEntry.ToShortTimeString();
            }
            DateTime dateT = Popups.GetLastEditDateTimeForPopup(PopupCur.PopupNum);

            textEditDate.Text = "";
            if (dateT.Year > 1880)
            {
                textEditDate.Text = dateT.ToShortDateString() + " " + dateT.ToShortTimeString();          //Sets the Edit date to the entry date of the last popup change that was archived for this popup.
            }
            for (int i = 1; i <= 4; i++)
            {
                comboMinutes.Items.Add(i.ToString());
            }
            for (int i = 1; i <= 11; i++)
            {
                comboMinutes.Items.Add((i * 5).ToString());
            }
            comboMinutes.Text = "10";
            for (int i = 1; i <= 12; i++)
            {
                comboHours.Items.Add(i.ToString());
            }
            comboHours.Text = "1";
            MinutesDisabled = 0;
            if (PopupCur.UserNum != Security.CurUser.UserNum &&
                !Security.IsAuthorized(Permissions.PopupEdit, true))
            {
                textDescription.ReadOnly = true;
            }
        }
Beispiel #3
0
 private void FormPopupEdit_Load(object sender, EventArgs e)
 {
     Pat = Patients.GetPat(PopupCur.PatNum);
     textPatient.Text = Pat.GetNameLF();
     if (PopupCur.IsNew)             //If popup is new User is the logged-in user and create date is now.
     {
         butAudit.Visible    = false;
         textUser.Text       = Security.CurUser.UserName;
         textCreateDate.Text = DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString();
     }
     else
     {
         if (PopupCur.UserNum != 0)               //This check is so that any old popups without a user will still display correctly.
         //Display last user to edit PopupCur, or "Unknown(5)" if user not found.
         {
             textUser.Text = Userods.GetUser(PopupCur.UserNum)?.UserName ?? (Lan.g(this, "Unknown") + $"({POut.Long(PopupCur.UserNum)})");
         }
         if (PopupAudit != null)               //This checks if this window opened from FormPopupAudit
         {
             textCreateDate.Text = "";
             if (PopupAudit.DateTimeEntry.Year > 1880)
             {
                 textCreateDate.Text = PopupAudit.DateTimeEntry.ToShortDateString() + " " + PopupAudit.DateTimeEntry.ToShortTimeString();                  //Sets the original creation date.
             }
             textEditDate.Text = "";
             if (DateLastEdit.Year > 1880)
             {
                 textEditDate.Text = DateLastEdit.ToShortDateString() + " " + DateLastEdit.ToShortTimeString();
             }
         }
         else
         {
             textCreateDate.Text = "";
             if (PopupCur.DateTimeEntry.Year > 1880)
             {
                 textCreateDate.Text = PopupCur.DateTimeEntry.ToShortDateString() + " " + PopupCur.DateTimeEntry.ToShortTimeString();                  //Sets the original creation date.
             }
             DateTime dateT = Popups.GetLastEditDateTimeForPopup(PopupCur.PopupNum);
             textEditDate.Text = "";
             if (dateT.Year > 1880)
             {
                 textEditDate.Text = dateT.ToShortDateString() + " " + dateT.ToShortTimeString();                  //Sets the Edit date to the entry date of the last popup change that was archived for this popup.
             }
         }
     }
     comboPopupLevel.Items.Add(Lan.g("enumEnumPopupFamily", Enum.GetNames(typeof(EnumPopupLevel))[0]));           //Patient
     comboPopupLevel.Items.Add(Lan.g("enumEnumPopupFamily", Enum.GetNames(typeof(EnumPopupLevel))[1]));           //Family
     if (Pat.SuperFamily != 0 || PopupCur.PopupLevel == EnumPopupLevel.SuperFamily)
     {
         //Previously if a superfamily head was moved out to their own family the associated superfamily popups were incorrectly copied.
         //This would cause the comboPopupLevel selection logic below to error.
         comboPopupLevel.Items.Add(Lan.g("enumEnumPopupFamily", Enum.GetNames(typeof(EnumPopupLevel))[2]));               //SuperFamily
     }
     comboPopupLevel.SelectedIndex = (int)PopupCur.PopupLevel;
     checkIsDisabled.Checked       = PopupCur.IsDisabled;
     textDescription.Text          = PopupCur.Description;
     if (!PopupCur.IsNew && PopupCur.UserNum != Security.CurUser.UserNum &&
         !Security.IsAuthorized(Permissions.PopupEdit, true))
     {
         butDelete.Enabled        = false;
         comboPopupLevel.Enabled  = false;
         textDescription.ReadOnly = true;
         textPatient.ReadOnly     = true;
         labelNoPerms.Visible     = true;
     }
     if (PopupCur.IsArchived)
     {
         butDelete.Enabled        = false;
         butOK.Enabled            = false;
         comboPopupLevel.Enabled  = false;
         checkIsDisabled.Enabled  = false;
         textDescription.ReadOnly = true;
         textPatient.ReadOnly     = true;
     }
     if (PopupCur.PopupNumArchive != 0)
     {
         butAudit.Visible = false;
     }
 }
Beispiel #4
0
 private void FormPopupEdit_Load(object sender, EventArgs e)
 {
     Pat = Patients.GetPat(PopupCur.PatNum);
     textPatient.Text = Pat.GetNameLF();
     if (PopupCur.IsNew)             //If popup is new User is the logged-in user and create date is now.
     {
         butAudit.Visible    = false;
         textUser.Text       = Security.CurUser.UserName;
         textCreateDate.Text = DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString();
     }
     else
     {
         if (PopupCur.UserNum != 0)               //This check is so that any old popups without a user will still display correctly.
         {
             textUser.Text = Userods.GetUser(PopupCur.UserNum).UserName;
         }
         if (PopupAudit != null)               //This checks if this window opened from FormPopupAudit
         {
             textCreateDate.Text = "";
             if (PopupAudit.DateTimeEntry.Year > 1880)
             {
                 textCreateDate.Text = PopupAudit.DateTimeEntry.ToShortDateString() + " " + PopupAudit.DateTimeEntry.ToShortTimeString();                  //Sets the original creation date.
             }
             textEditDate.Text = "";
             if (DateLastEdit.Year > 1880)
             {
                 textEditDate.Text = DateLastEdit.ToShortDateString() + " " + DateLastEdit.ToShortTimeString();
             }
         }
         else
         {
             textCreateDate.Text = "";
             if (PopupCur.DateTimeEntry.Year > 1880)
             {
                 textCreateDate.Text = PopupCur.DateTimeEntry.ToShortDateString() + " " + PopupCur.DateTimeEntry.ToShortTimeString();                  //Sets the original creation date.
             }
             DateTime dateT = Popups.GetLastEditDateTimeForPopup(PopupCur.PopupNum);
             textEditDate.Text = "";
             if (dateT.Year > 1880)
             {
                 textEditDate.Text = dateT.ToShortDateString() + " " + dateT.ToShortTimeString();                  //Sets the Edit date to the entry date of the last popup change that was archived for this popup.
             }
         }
     }
     comboPopupLevel.Items.Add(Lan.g("enumEnumPopupFamily", Enum.GetNames(typeof(EnumPopupLevel))[0]));           //Patient
     comboPopupLevel.Items.Add(Lan.g("enumEnumPopupFamily", Enum.GetNames(typeof(EnumPopupLevel))[1]));           //Family
     if (Pat.SuperFamily != 0)
     {
         comboPopupLevel.Items.Add(Lan.g("enumEnumPopupFamily", Enum.GetNames(typeof(EnumPopupLevel))[2]));               //SuperFamily
     }
     comboPopupLevel.SelectedIndex = (int)PopupCur.PopupLevel;
     checkIsDisabled.Checked       = PopupCur.IsDisabled;
     textDescription.Text          = PopupCur.Description;
     if (PopupCur.IsArchived)
     {
         butDelete.Enabled        = false;
         butOK.Enabled            = false;
         comboPopupLevel.Enabled  = false;
         checkIsDisabled.Enabled  = false;
         textDescription.ReadOnly = true;
         textPatient.ReadOnly     = true;
     }
     if (PopupCur.PopupNumArchive != 0)
     {
         butAudit.Visible = false;
     }
 }