Beispiel #1
0
        private void btnDismissAll_Click(object sender, EventArgs e)
        {
            try
            {
                int attendeeId;
                if (UIHelper.ConfirmDeleteReminders())
                {
                    foreach (Janus.Windows.GridEX.GridEXRow gri in gridEXNotification.GetRows())
                    {
                        if (gri.RowType == Janus.Windows.GridEX.RowType.Record)
                        {
                            attendeeId = (int)gri.Cells["AttendeeId"].Value;
                            atriumDB.AttendeeRow attrow = currentFM.DB.Attendee.FindByAttendeeId(attendeeId);
                            if (!attrow.IsNotificationDismissNull())
                            {
                                attrow.BeginEdit();
                                attrow.NotificationDismiss = true;
                                attrow.Interval            = 0;
                                attrow.EndEdit();
                            }
                        }
                    }

                    atLogic.BusinessProcess bp = currentFM.GetBP();
                    bp.AddForUpdate(currentFM.DB.Attendee);
                    bp.Update();

                    this.Close();
                }
            }
            catch (Exception x)
            {
                UIHelper.HandleUIException(x);
            }
        }
Beispiel #2
0
        private void btnDismiss_Click(object sender, EventArgs e)
        {
            try
            {
                int            attendeeId;
                List <DataRow> rowList = new List <DataRow>();

                foreach (Janus.Windows.GridEX.GridEXSelectedItem gsi in gridEXNotification.SelectedItems)
                {
                    if (gsi.RowType == Janus.Windows.GridEX.RowType.Record)
                    {
                        rowList.Add(((DataRowView)gsi.GetRow().DataRow).Row);
                    }
                }

                if (rowList.Count > 0)
                {
                    foreach (DataRow dr in rowList)
                    {
                        attendeeId = (int)dr["AttendeeId"];//.ItemArray[0];
                        atriumDB.AttendeeRow attrow = currentFM.DB.Attendee.FindByAttendeeId(attendeeId);
                        if (!attrow.IsNotificationDismissNull())
                        {
                            attrow.BeginEdit();
                            attrow.NotificationDismiss = true;
                            attrow.Interval            = 0;

                            attrow.EndEdit();
                        }
                        dr.Delete();
                        dr.AcceptChanges();
                    }
                    atLogic.BusinessProcess bp = currentFM.GetBP();
                    bp.AddForUpdate(currentFM.DB.Attendee);
                    bp.Update();

                    DataTable dt = (DataTable)bSourceAppointmentDataview.DataSource;
                    if (dt.Rows.Count == 0)
                    {
                        this.Close();
                    }
                    SetFormHeader(dt.Rows.Count);
                    Refresh();
                }
                else
                {
                    this.Close();
                }
            }
            catch (Exception x)
            {
                UIHelper.HandleUIException(x);
            }
        }
Beispiel #3
0
        protected override void AfterAdd(DataRow row)
        {
            atriumDB.AttendeeRow dr = (atriumDB.AttendeeRow)row;
            string ObjectName       = this.myAttendeeDT.TableName;

            //System.Diagnostics.Debug.WriteLine(dr["ContactId"] + dr.RowState.ToString() );

            dr.AttendeeId = this.myA.AtMng.PKIDGet(ObjectName, 10);
            dr.FileId     = myA.CurrentFileId;
            dr.Accepted   = false;
            dr.Declined   = false;
            dr.Required   = true;
            dr.Tentative  = false;
        }
Beispiel #4
0
        private void AddAttendee()
        {
            fContactSelect f = new fContactSelect(myFM, null, true);

            f.ShowDialog();

            if (f.ContactId != 0)
            {
                //if contact is allready an attendee ignore
                if (myFM.DB.Attendee.Select("ApptId=" + apptRow.ApptId.ToString() + " and ContactId=" + f.ContactId.ToString()).Length == 0)
                {
                    atriumDB.AttendeeRow attRow = (atriumDB.AttendeeRow)myFM.GetAttendee().Add(apptRow);
                    attRow.ContactId = f.ContactId;
                    AddAttendeeToTimeline(this.timeLine1.Fields["ContactId"], attRow);
                }
            }
            f.Close();
        }
Beispiel #5
0
        private void AddDummyAppointmentForFileContacts(atriumDB.AttendeeRow fcr)
        {
            //TODO only add if contactid not in timeline table
            var tx = from t in myFM.DB.TimeLine
                     where t.ContactId == fcr.ContactId
                     select t;

            if (tx.Count() == 0)
            {
                atriumDB.TimeLineRow appr = myFM.DB.TimeLine.NewTimeLineRow();
                appr.ContactId      = fcr.ContactId;
                appr.StartDate      = DateTime.Today.AddYears(-1);
                appr.EndDate        = DateTime.Today.AddYears(-1);
                appr.StartDateLocal = DateTime.Today.AddYears(-1);
                appr.EndDateLocal   = DateTime.Today.AddYears(-1);
                myFM.DB.TimeLine.AddTimeLineRow(appr);
            }
        }
Beispiel #6
0
        private void AddAttendeeToTimeline(TimeLineField ContactField, atriumDB.AttendeeRow atr)
        {
            var fcx = from fc in myFM.DB.FileContact
                      where fc.ContactId == atr.ContactId
                      select fc;

            if (fcx.Count() == 1)
            {
                atriumDB.FileContactRow fcr = fcx.Single();
                ContactField.ValueList.Add(new TimeLineValueListItem(atr.ContactId, fcr.DisplayName, 0));
            }
            else
            {
                atriumDB.ContactRow cr = myFM.GetPerson().Load(atr.ContactId);
                ContactField.ValueList.Add(new TimeLineValueListItem(atr.ContactId, cr.DisplayName, 0));
                //TODO find contact
            }

            myFM.GetAppointment().LoadByContactIdDates(atr.ContactId, RangeStartDate, RangeEndDate);

            AddDummyAppointmentForFileContacts(atr);
        }
Beispiel #7
0
 private void InitReminder()
 {
     try
     {
         officeDB.OfficerRow workingas = myFM.AtMng.WorkingAsOfficer;
         int OfficerId = workingas.OfficerId;
         atriumDB.AttendeeRow[] attws = (atriumDB.AttendeeRow[])myFM.DB.Attendee.Select("ApptId = " + apptRow.ApptId.ToString() + " AND ContactId =" + OfficerId.ToString());
         int len = attws.Length;
         if (len > 0)
         {
             atriumDB.AttendeeRow attw = attws[0];
             if (!attw.IsIntervalNull())
             {
                 apptRow.Interval = attw.Interval;
             }
         }
     }
     catch (Exception x)
     {
         UIHelper.HandleUIException(x);
     }
 }
Beispiel #8
0
        private void btnSnooze_Click(object sender, EventArgs e)
        {
            try
            {
                int            attendeeId;
                List <DataRow> rowList = new List <DataRow>();

                foreach (Janus.Windows.GridEX.GridEXSelectedItem gsi in gridEXNotification.SelectedItems)
                {
                    if (gsi.RowType == Janus.Windows.GridEX.RowType.Record)
                    {
                        rowList.Add(((DataRowView)gsi.GetRow().DataRow).Row);
                    }
                }

                if (rowList.Count > 0)
                {
                    foreach (DataRow dr in rowList)
                    {
                        attendeeId = (int)dr.ItemArray[0];
                        atriumDB.AttendeeRow    attrow = currentFM.DB.Attendee.FindByAttendeeId(attendeeId);
                        atriumDB.AppointmentRow approw = attrow.AppointmentRow;
                        if (!attrow.IsNotificationDismissNull())
                        {
                            attrow.BeginEdit();
                            attrow.NotificationDismiss = false;
                            int  SelectedValue;
                            bool result = Int32.TryParse(ucDDReminder.SelectedValue.ToString(), out SelectedValue);
                            if (result)
                            {
                                attrow.Interval = SelectedValue;
                            }
                            //
                            // Activate this option in 1.10
                            //
                            //TimeSpan TS = approw.StartDateLocal.Subtract(DateTime.Now);
                            //int SelectedValue;
                            //bool result = Int32.TryParse(ucDDReminder.SelectedValue.ToString(), out SelectedValue);
                            //if (result)
                            //{
                            //    double interval = TS.TotalMinutes - SelectedValue;
                            //    attrow.Interval = Convert.ToInt32(interval);
                            //}



                            attrow.EndEdit();
                        }
                        dr.Delete();
                        dr.AcceptChanges();
                    }
                    atLogic.BusinessProcess bp = currentFM.GetBP();
                    bp.AddForUpdate(currentFM.DB.Attendee);
                    bp.Update();

                    DataTable dt = (DataTable)bSourceAppointmentDataview.DataSource;
                    if (dt.Rows.Count == 0)
                    {
                        this.Close();
                    }
                    SetFormHeader(dt.Rows.Count);
                    Refresh();
                }
                else
                {
                    this.Close();
                }
            }
            catch (Exception x)
            {
                UIHelper.HandleUIException(x);
            }
        }
Beispiel #9
0
        protected override void AfterChange(DataColumn dc, DataRow row)
        {
            SST.HearingRow dr = (SST.HearingRow)row;
            switch (dc.ColumnName)
            {
            case  "ApptId":
                //add all the filecontacts as attendees
                //atriumDB.AppointmentRow appr = myA.FM.DB.Appointment.FindByApptId(dr.ApptId);
                //foreach (SST.FilePartyRow fcr in myA.DB.FileParty)
                //{
                //    atriumDB.AttendeeRow ar = (atriumDB.AttendeeRow)myA.FM.GetAttendee().Add(appr);
                //    ar.ContactId = fcr.PartyId;
                //    ar.Accepted = true;
                //}
                break;

            case "HearingToCloneId":
                SST.HearingRow drHearing2Clone = (SST.HearingRow)myA.DB.Hearing.Select("ApptId=" + dr.HearingToCloneId)[0];

                //are attendees loaded already?
                //myA.FM.GetAttendee().LoadByApptId(drHearing2Clone.ApptId);

                //find new appointment
                atriumDB.AppointmentRow apptRow    = myA.FM.DB.Appointment.FindByApptId(dr.ApptId);
                atriumDB.AppointmentRow oldApptRow = myA.FM.DB.Appointment.FindByApptId(drHearing2Clone.ApptId);
                oldApptRow.ShowAsBusy = false;

                //add attendees for each attendee in cloned hearing
                foreach (atriumDB.AttendeeRow attendeerow in myA.FM.DB.Attendee.Select("ApptId=" + drHearing2Clone.ApptId))
                {
                    atriumDB.AttendeeRow newAttendee = (atriumDB.AttendeeRow)myA.FM.GetAttendee().Add(apptRow);
                    newAttendee.ContactId = attendeerow.ContactId;
                }
                dr.HearingMethodId = drHearing2Clone.HearingMethodId;
                apptRow.Subject    = oldApptRow.Subject;

                break;

            case "HearingMethodId":
                if (!dr.IsHearingMethodIdNull())
                {
                    if (dr.HearingMethodId != 3)     // teleconference
                    {
                        dr.SetSecurityPINNull();
                    }
                }
                break;

            case "PINMode":
                if (!dr.IsHearingMethodIdNull())
                {
                    if (dr.HearingMethodId == 3)     // teleconference
                    {
                        atriumDB.FileContactRow fcrTM = myA.FM.GetFileContact().GetByRole("FTM");
                        //SST.HearingDataTable hdt = myDAL.LoadByMemberId(fcrTM.ContactId);
                        DataTable dt     = myA.AtMng.GetGeneralRec("select * from vddeSecurityPIN where OfficerID=" + fcrTM.ContactId.ToString());
                        Random    random = new Random();

                        int PIN = 0;

                        if (!dr.IsPINModeNull())
                        {
                            if (!dr.IsSecurityPINNull())
                            {
                                dr.PreviousSecurityPIN = dr.SecurityPIN;
                            }
                            else
                            {
                                //see if there this member already has a PIN for the file.
                                DataRow[] drs = dt.Select("Fileid=" + dr.FileID.ToString());
                                if (drs.Length > 0)
                                {
                                    dr.SecurityPIN         = (int)drs[0]["SecurityPIN"];
                                    dr.PreviousSecurityPIN = dr.SecurityPIN;
                                }
                                else
                                {
                                    dr.PreviousSecurityPIN = 0;
                                }
                            }
                            if (dr.PINMode == 1 || dr.PINMode == 3 || dr.IsSecurityPINNull())   // generate new PIN
                            {
                                PIN = GeneratePIN(dt);
                            }
                            else     // check for duplicates not on the same file
                            {
                                DataRow[] drs = dt.Select("SecurityPIN=" + dr.SecurityPIN.ToString() + " and Fileid<>" + dr.FileID.ToString());
                                if (drs.Length > 0)
                                {
                                    PIN = GeneratePIN(dt);
                                }
                                else
                                {
                                    dr.PreviousSecurityPIN = 0;     //this is to force the current PIN into the member's PIN history
                                    PIN = dr.SecurityPIN;
                                }
                            }
                        }

                        dr.SecurityPIN = PIN;
                    }
                }
                break;
            }
        }