Example #1
0
        void UpdateStatus(AppoimantsStatus_SP status)
        {
            try
            {
                SelectedAppointment.Status = (int)status;
                //TODO: Set SelectedTimespamView.Appoiment to canceled in database

                AppointmentList appList = new AppointmentList();
                //if (!String.IsNullOrEmpty(SelectedTimespamView.Appointment.GroupId))
                appList.Add(SelectedAppointment);
                //else
                //{
                //    var appList_aux = (from s in AppointmentList where s.GroupId.Equals(s) select s).ToList<AppointmentBE>();
                //    appList_aux.ForEach(p => { p.Status = (int)status; });
                //    appList.AddRange(appList_aux);
                //}
                ServiceCalls.UpdateAppoiment(appList);
            }
            catch (Exception ex)
            {
                this.ExceptionViewer.Show(ex);
            }


            OnChangeStatus(status);
            //gridControl2.RefreshDataSource();
            //gridView2.RefreshData();
            Refresh();
        }
Example #2
0
        internal static string  GetImageStatusKey(AppoimantsStatus_SP status)
        {
            //this.imageList2.Images.SetKeyName(0, "AppoimentStatus_Reserved.ICO");
            //this.imageList2.Images.SetKeyName(1, "AppoimentStatusWaiting.png");
            //this.imageList2.Images.SetKeyName(2, "AppoimentStatusInAttention.png");
            //this.imageList2.Images.SetKeyName(3, "AppoimentStatusClosed.png");
            //this.imageList2.Images.SetKeyName(4, "AppoimentStatusCanceled.png");
            //this.imageList2.Images.SetKeyName(5, "AppoimentStatus_FreeToUse.png");
            //this.imageList2.Images.SetKeyName(6, "AppoimentStatus_Expiro.png");
            switch (status)
            {
            case AppoimantsStatus_SP.Reservado:
                return("AppoimentStatus_Reserved.ICO");

            case AppoimantsStatus_SP.EnEspera:
                return("AppoimentStatusWaiting.png");

            case AppoimantsStatus_SP.EnAtencion:
                return("AppoimentStatusInAttention.png");

            case AppoimantsStatus_SP.Cerrado:
                return("AppoimentStatusClosed.png");

            case AppoimantsStatus_SP.Cancelado:
                return("AppoimentStatusCanceled.png");

            case AppoimantsStatus_SP.Expirado:
                return("AppoimentStatus_Expiro.png");
            }
            return("AppoimentStatus_FreeToUse.png");
        }
Example #3
0
 void OnChangeStatus(AppoimantsStatus_SP status)
 {
     if (ChangeStatusEvent != null)
     {
         ChangeStatusEvent(status, new EventArgs());
     }
 }
        void UpdateStatus(AppoimantsStatus_SP status)
        {
            try
            {
                SelectedAppointment.Status = (int)status;
                //TODO: Set SelectedTimespamView.Appoiment to canceled in datanbase

                AppointmentList appList = new AppointmentList();

                appList.Add(SelectedAppointment.Get_Appointments());

                //else
                //{
                //    var appList_aux = (from s in AppointmentList where s.GroupId.Equals(s) select s).ToList<AppointmentBE>();
                //    appList_aux.ForEach(p => { p.Status = (int)status; });
                //    appList.AddRange(appList_aux);
                //}
                Controller.UpdateAppoimentStatus(appList);
            }
            catch (Exception ex)
            {
                this.ExceptionViewer.Show(ex);
            }


            //OnChangeStatus(status);
            gridControl2.RefreshDataSource();
            gridView2.RefreshData();
        }
Example #5
0
        void UpdateStatus(AppoimantsStatus_SP status)
        {
            AppointmentList appList = new AppointmentList();

            SelectedTimespamView.Appointment.Status = (int)status;

            if (status.Equals(AppoimantsStatus_SP.Cancelado))
            {
                if (SelectedTimespamView.Appointment.IsExceptional)
                {
                    appList.Add(SelectedTimespamView.Appointment);

                    Controller.RemoveAppoiment(SelectedTimespamView.Appointment.AppointmentId);

                    OnChangeStatus(status);
                    Refresh();
                    return;
                }
            }
            //    AppointmentBE app =  SelectedTimespamView.Appointment.Clone<AppointmentBE>();
            //    app.Subject = string.Concat(Enum.GetName(typeof(AppoimantsStatus_SP),status), " a las : ", SelectedTimespamView.Appointment.TimeEnd);
            //    app.Status = (int)status;
            //    appList.Add(app);

            //    try
            //    {
            //        Controller.CreateAppointments(app);

            //        if (OnCreateAppoimentsEvent != null)
            //            OnCreateAppoimentsEvent(app, new EventArgs());


            //    }

            //    catch (Exception ex)
            //    {
            //        this.ExceptionViewer.Show(ex);
            //    }

            //}

            try
            {
                appList.Add(SelectedTimespamView.Appointment);

                Controller.UpdateAppoiment(appList);

                OnChangeStatus(status);
                Refresh();
            }
            catch (Exception ex)
            {
                this.ExceptionViewer.Show(ex);
            }
        }
Example #6
0
        public static void Update_Appointment_Status(int AppointmentId, AppoimantsStatus_SP status, Guid userId)
        {
            DateTime updateDate = System.DateTime.Now;

            using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities))
            {
                var appointment_db = dc.Appointments.Where <Appointment>(p => p.AppointmentId.Equals(AppointmentId)).FirstOrDefault();

                appointment_db.UpdatedDate  = updateDate;
                appointment_db.UpdateUserId = userId;
                appointment_db.Status       = (int)status;

                dc.SaveChanges();
            }
        }
Example #7
0
 void OnChangeStatus(AppoimantsStatus_SP status)
 {
     if (OnChangeStatusEvent != null)
         OnChangeStatusEvent(status, new EventArgs());
 }
Example #8
0
        void UpdateStatus(AppoimantsStatus_SP status)
        {
            AppointmentList appList = new AppointmentList();
            SelectedTimespamView.Appointment.Status = (int)status;

            if (status.Equals(AppoimantsStatus_SP.Cancelado) )
            {
                if (SelectedTimespamView.Appointment.IsExceptional                    )
                {
                    appList.Add(SelectedTimespamView.Appointment);
                    
                    ServiceCalls.RemoveAppoiment(SelectedTimespamView.Appointment.AppointmentId);

                    OnChangeStatus(status);
                    Refresh();
                    return;
                }
            }
            //    AppointmentBE app =  SelectedTimespamView.Appointment.Clone<AppointmentBE>();
            //    app.Subject = string.Concat(Enum.GetName(typeof(AppoimantsStatus_SP),status), " a las : ", SelectedTimespamView.Appointment.TimeEnd);
            //    app.Status = (int)status;
            //    appList.Add(app);
               
            //    try
            //    {
            //        Controller.CreateAppointments(app);
                    
            //        if (OnCreateAppoimentsEvent != null)
            //            OnCreateAppoimentsEvent(app, new EventArgs());

                   
            //    }

            //    catch (Exception ex)
            //    {
            //        this.ExceptionViewer.Show(ex);
            //    }

            //}

            try
            {
      
                appList.Add(SelectedTimespamView.Appointment);
        
                ServiceCalls.UpdateAppoiment(appList);

                OnChangeStatus(status);
                Refresh();
            }
            catch (Exception ex)
            {
                this.ExceptionViewer.Show(ex);
            }
        }
Example #9
0
        void UpdateStatus(AppoimantsStatus_SP status)
        {
            try
            {
                SelectedAppointment.Status = (int)status;
                //TODO: Set SelectedTimespamView.Appoiment to canceled in database

                AppointmentList appList = new AppointmentList();
                //if (!String.IsNullOrEmpty(SelectedTimespamView.Appointment.GroupId))
                appList.Add(SelectedAppointment);
                //else
                //{
                //    var appList_aux = (from s in AppointmentList where s.GroupId.Equals(s) select s).ToList<AppointmentBE>();
                //    appList_aux.ForEach(p => { p.Status = (int)status; });
                //    appList.AddRange(appList_aux);
                //}
                ServiceCalls.UpdateAppoiment(appList);

                
            }
            catch (Exception ex)
            {
                this.ExceptionViewer.Show(ex);
            }

           
            OnChangeStatus(status);
            //gridControl2.RefreshDataSource();
            //gridView2.RefreshData();
            Refresh();
        }
        void UpdateStatus(AppoimantsStatus_SP status)
        {
            try
            {
                SelectedAppointment.Status = (int)status;
                //TODO: Set SelectedTimespamView.Appoiment to canceled in datanbase

                AppointmentList appList = new AppointmentList();
           
                appList.Add(SelectedAppointment.Get_Appointments());
                
                //else
                //{
                //    var appList_aux = (from s in AppointmentList where s.GroupId.Equals(s) select s).ToList<AppointmentBE>();
                //    appList_aux.ForEach(p => { p.Status = (int)status; });
                //    appList.AddRange(appList_aux);
                //}
                Controller.UpdateAppoimentStatus(appList);


            }
            catch (Exception ex)
            {
                this.ExceptionViewer.Show(ex);
            }


            //OnChangeStatus(status);
            gridControl2.RefreshDataSource();
            gridView2.RefreshData();
        }
Example #11
0
        public static void Update_Appointment_Status(int AppointmentId,AppoimantsStatus_SP status, Guid userId)
        {
         
            DateTime updateDate = System.DateTime.Now;

            using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities))
            {


                var appointment_db = dc.Appointments.Where<Appointment>(p => p.AppointmentId.Equals(AppointmentId)).FirstOrDefault();

                    appointment_db.UpdatedDate = updateDate;
                    appointment_db.UpdateUserId = userId;
                    appointment_db.Status = (int)status;
                
                dc.SaveChanges();
            }
        }