Exemple #1
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     registrationKey.RegKey = textKey.Text;
     registrationKey.Note   = textNote.Text;
     RegistrationKeys.Update(registrationKey);
     DialogResult = DialogResult.OK;
 }
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textDateStarted.errorProvider1.GetError(textDateStarted) != "" ||
         textDateDisabled.errorProvider1.GetError(textDateDisabled) != "" ||
         textDateEnded.errorProvider1.GetError(textDateEnded) != ""
         )
     {
         MsgBox.Show(this, "Please fix data entry errors first.");
         return;
     }
     try {
         PIn.Int(textVotesAllotted.Text);
     }
     catch {
         MsgBox.Show(this, "Votes Allotted is invalid.");
         return;
     }
     //RegKey.RegKey=textKey.Text;//It's read only.
     RegKey.DateStarted        = PIn.Date(textDateStarted.Text);
     RegKey.DateDisabled       = PIn.Date(textDateDisabled.Text);
     RegKey.DateEnded          = PIn.Date(textDateEnded.Text);
     RegKey.IsFreeVersion      = checkFree.Checked;
     RegKey.IsOnlyForTesting   = checkTesting.Checked;
     RegKey.IsResellerCustomer = checkResellerCustomer.Checked;
     //RegKey.UsesServerVersion=checkServerVersion.Checked;
     RegKey.VotesAllotted  = PIn.Int(textVotesAllotted.Text);
     RegKey.Note           = textNote.Text;
     RegKey.HasEarlyAccess = checkEarlyAccess.Checked;
     RegistrationKeys.Update(RegKey);
     DialogResult = DialogResult.OK;
 }
        private void butMoveTo_Click(object sender, EventArgs e)
        {
            FormPatientSelect form = new FormPatientSelect();

            if (form.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            RegKey.PatNum = form.SelectedPatNum;
            RegistrationKeys.Update(RegKey);
            MessageBox.Show("Registration key moved successfully");
            DialogResult = DialogResult.OK;          //Chart module grid will refresh after closing this form, showing that the key is no longer in the ptinfo grid of the chart.
        }
Exemple #4
0
        private void butDelete_Click(object sender, EventArgs e)
        {
            //Only Jordan should be able to delete resellers.
            if (!Security.IsAuthorized(Permissions.SecurityAdmin))
            {
                return;
            }
            //Do not let the reseller be deleted if they have customers in their list.
            if (Resellers.HasActiveResellerCustomers(ResellerCur))
            {
                MsgBox.Show(this, "This reseller cannot be deleted until all active services are removed from their customers.  This should be done using the reseller portal.");
                return;
            }
            if (!MsgBox.Show(this, MsgBoxButtons.YesNo, "This will update PatStatus to inactive and set every registartion key's stop date.\r\nContinue?"))
            {
                return;
            }
            Patient patOld = Patients.GetPat(ResellerCur.PatNum);
            Patient patCur = patOld.Copy();

            patCur.PatStatus = PatientStatus.Inactive;
            Patients.Update(patCur, patOld);
            RegistrationKey[] regKeys = RegistrationKeys.GetForPatient(patCur.PatNum);
            for (int i = 0; i < regKeys.Length; i++)
            {
                DateTime dateTimeNow = MiscData.GetNowDateTime();
                if (regKeys[i].DateEnded.Year > 1880 && regKeys[i].DateEnded < dateTimeNow)
                {
                    continue;                    //Key already ended.  Nothing to do.
                }
                regKeys[i].DateEnded = MiscData.GetNowDateTime();
                RegistrationKeys.Update(regKeys[i]);
            }
            Resellers.Delete(ResellerCur.ResellerNum);
            DialogResult = DialogResult.OK;
        }