Exemple #1
0
        public async void PrinList()
        {
            try
            {
                decimal totSaldoReporte = 0;
                var     fechaOperacion  = SelectedDate.ToString("dd/MM/yyyy HH:mm:ss");

                String dataToPrint = "$big$Cooperativa de Ahorro y Credito$intro$   Indigena SAC Pelileo Ltda.$intro$$intro$";

                dataToPrint += "$small$Usuario: " + CodigoUsuario + "$intro$";
                dataToPrint += "$small$Fecha: " + fechaOperacion + "$intro$";

                foreach (var item in TransacccionCollection.ToList())
                {
                    totSaldoReporte += item.Monto;
                    dataToPrint     += "$small$" + item.NombreCliente + " " + item.Monto.ToString("N2") + "$intro$";
                }

                dataToPrint += "$intro$Total Operacion: " + totSaldoReporte.ToString("N2");
                dataToPrint += "$intro$$intro$$cut$$intro$";

                printReport = new PrintReport();

                printReport.Print(dataToPrint);
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #2
0
        public string GetCurrentMonthAndYear()
        {
            if (ViewType == ViewTypes.Day)
            {
                return(SelectedDate.ToString("dd MMMM yyyy"));
            }

            string   startMonth    = StartOfWeekDate.ToString("MMMM");
            string   startYear     = StartOfWeekDate.ToString("yyyy");
            DateTime endOfWeekDate = StartOfWeekDate.AddDays(6);
            string   endMonth      = endOfWeekDate.ToString("MMMM");
            string   endYear       = endOfWeekDate.ToString("yyyy");
            string   monthAndYear;

            if (endYear == startYear)
            {
                if (endMonth == startMonth)
                {
                    monthAndYear = startMonth + " " + startYear;
                }
                else
                {
                    monthAndYear = startMonth + " - " + endMonth + " " + startYear;
                }
            }
            else
            {
                monthAndYear = startMonth + " " + startYear + " - " + endMonth + " " + endYear;
            }

            return(monthAndYear);
        }
        public async void DisplayPatientListOnPatientsearch()
        {
            try
            {
                string format = SelectedDate.ToString("dd-MM-yy", CultureInfo.InvariantCulture);

                if (Connectivity.NetworkAccess == NetworkAccess.Internet)
                {
                    try
                    {
                        //start progessring
                        IsPageEnabled = true;
                        HttpClient httpClient = new System.Net.Http.HttpClient();

                        HttpRequestMessage  request  = new HttpRequestMessage(HttpMethod.Get, Library.URL + "/PullpatientData_by_patientname/" + Library.KEY_USER_SiteCode + "/" + format + "/" + PatientName);
                        HttpResponseMessage response = await httpClient.SendAsync(request);

                        var data = await response.Content.ReadAsStringAsync();

                        // JArray jarray = JArray.Parse(data);

                        var pdataList = JsonConvert.DeserializeObject <ObservableCollection <mstr_patient_info> >(data);

                        if (!pdataList.Any())
                        {
                            IsPageEnabled = false;
                            DependencyService.Get <INotify>().ShowToast("No patient found!!");
                            return;
                        }


                        foreach (var item in pdataList)
                        {
                            item.ward_bed = item.ward_name + "-" + item.bed_name;
                            item.ID       = item.ID;
                            if (string.Equals(item.is_care_giver, "true", StringComparison.CurrentCultureIgnoreCase))
                            {
                                item.Patientname = item.Patientname + ' ' + "(Care Giver)";
                            }
                        }

                        Patients      = new ObservableCollection <mstr_patient_info>(pdataList);
                        IsPageEnabled = false;
                    }
                    catch (Exception excp)
                    {
                        // stop progressring
                        IsPageEnabled = false;
                    }
                }
                else
                {
                    var data = _patientRepo.QueryTable().Where(x => x.Patientname == PatientName && x.meal_order_date == format).OrderBy(y => y.Patientname);
                    Patients = new ObservableCollection <mstr_patient_info>(data);
                }
            }
            catch (Exception)
            {
            }
        }
        private void GetOfflinePatients(string param)
        {
            string order_date = SelectedDate.ToString("dd-MM-yyyy", CultureInfo.InvariantCulture);

            if (param.Equals("WardNo"))
            {
                var wbed        = SelectedBed != null ? (SelectedBed.bed_no == "All" ? "0" : SelectedBed.bed_no) : "0";
                var patientlist = new List <mstr_patient_info>();
                if (wbed == "0")
                {
                    patientlist = _patientRepo.QueryTable().Where(x => x.ward_name == SelectedWard.ward_name && x.meal_order_date == order_date).OrderBy(x => x.bed_no).ToList();
                }
                else
                {
                    patientlist = _patientRepo.QueryTable().Where(x => x.ward_name == SelectedWard.ward_name && x.bed_name == wbed && x.meal_order_date == order_date).OrderBy(x => x.bed_no).ToList();
                }


                Patients = new ObservableCollection <mstr_patient_info>(patientlist);

                if (!Patients.Any())
                {
                    DependencyService.Get <INotify>().ShowToast("No patient found!!");
                }
            }
            else
            {
                DisplayPatientListOnPatientsearch();
            }
        }
Exemple #5
0
        protected void OnSelectedDateChanged()
        {
            string fomatString = Mode == PerformanceViewMode.Daily ? "d" : "MMMM, yyyy";

            SelectedDateString = SelectedDate.ToString(fomatString);
            RequestData();
        }
        private void FilterList(object obj)
        {
            TechnicianCollection = new ObservableCollection <Technician>();

            if (string.IsNullOrEmpty(SelectedTime.ToString()) && string.IsNullOrEmpty(SelectedDate.ToString()))
            {
                MessageBox.Show("Please complete all fields");
                return;
            }

            foreach (Technician tech in TechList)
            {
                if (CompareTime(SelectedTime.ToString(), tech.StartTime, tech.EndTime))
                {
                    TechnicianCollection.Add(tech);
                }
            }


            Order.Time = SelectedTime.ToString();
            Order.Date = SelectedDate.ToString().Substring(0, 10);

            FilterTechnicianVM FilterTechnicianVM = new FilterTechnicianVM(this, Order, User);
            FilterTechnician   filterTechnician   = new FilterTechnician();

            filterTechnician.DataContext = FilterTechnicianVM;
            filterTechnician.ShowDialog();
        }
        public void SetEthioValues(bool toEthio)
        {
            try
            {
                _toEthio = toEthio;
                DateTime gregorDayFrom = SelectedDate;
                string   ethioDayFrom  = CalendarUtil.GetEthCalendar(gregorDayFrom, false);
                int      dayf          = Convert.ToInt32(ethioDayFrom.Substring(0, 2)),
                         monthf        = Convert.ToInt32(ethioDayFrom.Substring(2, 2)),
                         yearf = Convert.ToInt32(ethioDayFrom.Substring(4, 4));
                SelectedEthioDay   = EthioDays[dayf - 1];
                SelectedEthioMonth = EthioMonths[monthf - 1];
                SelectedEthioYear  = EthioYears[yearf - 1900];

                SelectedDateMonth = SelectedDate.ToString("MMMM").ToUpper() + " (" + SelectedDate.Month + ")";
                SelectedDateDay   = SelectedDate.Day.ToString();
                SelectedDateYear  = SelectedDate.Year.ToString();

                _toEthio = false;
            }
            catch
            {
                //MessageBox.Show("Can't convert, may be out side of the scope!");
            }
        }
Exemple #8
0
        public void GetUnitList()
        {
            try
            {
                string returnMessage;
                UnitList = new ObservableCollection <UnitVM>();

                _currentFilteredDate      = SelectedDate;
                _currentFilteredWorkShift = SelectedWorkShift;

                _currentFilterTime = VerifyShiftTime();

                List <UnitForceMapModel> unitList = UnitForceMapBusiness.GetUnitForceMapList(SelectedRegion,
                                                                                             SelectedDate, SelectedWorkShift, CurrentFilterTime, (int)SelectedFilterType, out returnMessage);

                foreach (var u in unitList)
                {
                    var unitVM = new UnitVM(u, "Red");
                    UnitList.Add(unitVM);
                }
                SelectedUnit = null;

                FilterUnitCount = unitList.Count.ToString();

                CurrentActiveFilter = SelectedDate.ToString("dd/MM/yyyy") +
                                      " das " + SelectedWorkShift.InicialTime.Hours.ToString().PadLeft(2, '0') + " às " + SelectedWorkShift.FinalTime.Hours.ToString().PadLeft(2, '0') +
                                      " (" + (SelectedFilterType == FilterTypeEnum.ALL ? "Todas AMs" : string.Empty) + (SelectedFilterType == FilterTypeEnum.OUT_SERVICE ? "AMs fora de serviço" : string.Empty) + (SelectedFilterType == FilterTypeEnum.IN_SERVICE ? "AMs em serviço" : string.Empty) +
                                      (string.IsNullOrEmpty(SelectedRegion) ? string.Empty : " da região " + SelectedRegion) + ")";
            }
            catch (Exception ex)
            {
                ShowMessage(ex.Message);
            }
        }
        private async void ExecuteSave()
        {
            Form.StartTime = StartTime.ToString();
            Form.EndTime   = EndTime.ToString();
            Form.Date      = SelectedDate.ToString("yyyy-MM-dd");
            HttpResponseMessage response;

            if (Form.Title == null || Form.Description == null || Form.Location == null)
            {
                _userDialogs.Toast("Please fill all the fields", TimeSpan.FromSeconds(3));
                return;
            }

            if (_is_new)
            {
                response = await _apiManager.PostEvent(Config.Token, Form);
            }
            else
            {
                response = await _apiManager.PatchEvent(Config.Token, Form.Code, Form);
            }

            if (response.IsSuccessStatusCode)
            {
                _userDialogs.Toast("Event successfully saved. Please reload the calendar to reflect the changes", TimeSpan.FromSeconds(3));
                await _navigationService.GoBackAsync();
            }
        }
Exemple #10
0
        private List <Reservation> CreateDailyReservationEntries(List <Reservation> reservations)
        {
            var dateKey = int.Parse(SelectedDate.ToString("yyyyMMdd"));

            var dailyReservations = new List <Reservation>();

            for (int hour = 10; hour < 21; hour++)
            {
                var reservationForHour = reservations.FirstOrDefault(r => r.HourKey == hour);

                var year  = SelectedDate.Date.Year;
                var month = SelectedDate.Date.Month;
                var day   = SelectedDate.Date.Day;

                var dateX = new DateTime(year, month, day, hour, 0, 0);

                if (reservationForHour == null)
                {
                    reservationForHour = new Reservation {
                        HourKey = hour, DateKey = dateKey, Date = dateX
                    };
                }

                reservationForHour.HourDescription = $"{hour}:00 - {hour + 1}:00";

                dailyReservations.Add(reservationForHour);
            }

            return(dailyReservations);
        }
        private void PushToSingleton()
        {
            BookingSingleton singleton = BookingSingleton.Instance;
            string           myDate    = SelectedDate.ToString("dd/MM/yyyy");
            DateTimePeriod   date      = DateTimePeriodConverter.ToDate(myDate);

            singleton.SelectedDate = date;
        }
Exemple #12
0
 private async void OnSelectedShippingTagChanged()
 {
     if (!string.IsNullOrEmpty(this.SelectedShippingTag))
     {
         var date   = SelectedDate.ToString("yyyy-M-d");
         var tagstr = this.SelectedShippingTag;
         await _navigationService.NavigateAsync("DeliveriesPage?date=" + date + "&tag=" + tagstr);
     }
 }
Exemple #13
0
 protected void dlCalendar_ItemDataBound(object sender, DataListItemEventArgs e)
 {
     // Just populationg my header section
     if (e.Item.ItemType == ListItemType.Header)
     {
         //((Label)e.Item.FindControl("lblLeft")).Text = "<a style=color:Black href=CarianJalanTersedia.aspx?SpecificMonth=" + dDate.AddMonths(-1).ToString("dd-MMMM-yyyy") + ">" + dDate.AddMonths(-1).ToString("MMMM yyyy") + "</a>";
         ((Label)e.Item.FindControl("lblMiddle")).Text = SelectedDate.ToString("MMMM yyyy");
         //((Label)e.Item.FindControl("lblRight")).Text = "<a style=color:Black href=CarianJalanTersedia.aspx?SpecificMonth=" + dDate.AddMonths(+1).ToString("dd-MMMM-yyyy") + ">" + dDate.AddMonths(+1).ToString("MMMM yyyy") + "</a>";
     }
 }
Exemple #14
0
        private async Task GetGiveXReport()
        {
            _giveXReport = await _givexBussinessLogic.GetGiveXReport(SelectedDate.ToString("dd/MM/yyyy", CultureInfo.InvariantCulture));

            var tempGiveXReport = MapGiveXReport(_giveXReport);

            ReportText = _giveXReport.CloseBatchReport?.ReportContent;

            GiveXReports = new ObservableCollection <GiveXReportModel>(tempGiveXReport);
        }
Exemple #15
0
        private void DateDisplay_LostFocus(object sender, RoutedEventArgs e)
        {
            DateDisplay.Text = SelectedDate.ToString(DateFormat);

            try
            {
                DateDisplay.SelectionLength = 0;
            }
            catch (NullReferenceException) { }
        }
        private void AssignPatientInfo(mstr_patient_info patient)
        {
            Library.KEY_PATIENT_IS_HALAL = patient.ishalal_tab;
            Library.KEY_PATIENT_IS_VEG   = patient.isveg_tab;
            Library.KEY_ORDER_DATE       = SelectedDate.ToString("dd/MM/yyyy", CultureInfo.InvariantCulture);
            Library.KEY_CHECK_ORDER_DATE = SelectedDate.ToString("dd-MM-yyyy", CultureInfo.InvariantCulture);

            var id = Convert.ToInt32(patient.Ward_ID);

            Library.KEY_PATIENT_WARD_TYPE_ID = _mstrWardRepo.QueryTable().FirstOrDefault(x => x.ID == id).ward_type;
        }
Exemple #17
0
 private void DateDisplay_LostFocus(object sender, System.Windows.RoutedEventArgs e)
 {
     DateDisplay.Text = SelectedDate.ToString(DateFormat);
     // When the user selects a field again, then the box loses focus, then
     // the user clicks the same field again, the selection is cleared,
     // causing the arrows not to appear. To fix, clear selection in advance.
     try {
         DateDisplay.SelectionLength = 0;
     } catch (NullReferenceException) {
         // Occurs during shutdown. Bug in WPF? Ain't documented, that's for sure.
     }
 }
Exemple #18
0
        public async void DisplayPatientListOnPatientsearch()
        {
            try
            {
                string format = SelectedDate.ToString("dd-MM-yyyy", CultureInfo.InvariantCulture);

                if (CrossConnectivity.Current.IsConnected == true)
                {
                    try
                    {
                        //start progessring
                        IsPageEnabled = true;
                        HttpClient httpClient = new System.Net.Http.HttpClient();

                        HttpRequestMessage  request  = new HttpRequestMessage(HttpMethod.Get, Library.URL + "/PullpatientData_by_patientname/" + Library.KEY_USER_SiteCode + "/" + format + "/" + PatientName);
                        HttpResponseMessage response = await httpClient.SendAsync(request);

                        var data = await response.Content.ReadAsStringAsync();

                        // JArray jarray = JArray.Parse(data);

                        var pdataList = JsonConvert.DeserializeObject <ObservableCollection <mstr_patient_info> >(data);

                        foreach (var item in pdataList)
                        {
                            item.ward_bed = item.ward_name + "-" + item.bed_name;
                            item.ID       = item.ID;
                            if (item.is_care_giver)
                            {
                                item.Patientname = item.Patientname + ' ' + "(Care Giver)";
                            }
                        }

                        Patients      = new ObservableCollection <mstr_patient_info>(pdataList);
                        IsPageEnabled = false;
                    }
                    catch (Exception)
                    {
                        // stop progressring
                        IsPageEnabled = false;
                    }
                }
                else
                {
                    var data = _patientRepo.QueryTable().Where(x => x.Patientname == PatientName && x.meal_order_date == format).OrderBy(y => y.Patientname);
                    Patients = new ObservableCollection <mstr_patient_info>(data);
                }
            }
            catch (Exception)
            {
            }
        }
Exemple #19
0
        public async void BookTripNow()
        {
            if (IsBusy)
            {
                return;
            }
            IsBusy = true;

            if (Email.Length == 0 || !Email.Contains("@") ||
                Name.Length == 0 || Phone.Length == 0 || Persons.Length == 0)
            {
                await showDialog("Alert!", "Please enter all information first.");
            }
            else
            {
                var dialog = UserDialogs.Instance;
                dialog.ShowLoading("Please wait...", MaskType.Black);
                string time = "";

                if (BookingTimes.Count > SelectedTimeIndex)
                {
                    time = BookingTimes[SelectedTimeIndex];
                }

                BookingResponse response = await dataService.BookTrip(RecievedBooking.id, Name, Phone, Persons,
                                                                      (string)Email.ToLower(),
                                                                      SelectedDate.ToString(), time);

                if (response != null)
                {
                    if (response.status.Equals("failure"))
                    {
                        await showDialog("Alert!", "Oops, " + response.message);
                    }
                    else if (response.status.Equals("success"))
                    {
                        dialog.HideLoading();
                        await showDialog("Success", "Your tour booking is sent, you will be contacted by administrator for confirmation. Thank you");

                        await _navigationService.NavigateAsync("MainPage");
                    }
                    dialog.HideLoading();
                }
                else
                {
                    dialog.HideLoading();
                    await showDialog("Alert!", "You are not connected to internet, please try again later.");
                }
            }

            IsBusy = false;
        }
Exemple #20
0
        private void DateDisplay_LostFocus(object sender, System.Windows.RoutedEventArgs e)
        {
            DateTime?date = ParseDateText(true);

            if (date == null)
            {
                DateDisplay.Text = SelectedDate.ToString(DateFormat);
            }
            else if (SelectedDate != date.Value)
            {
                SelectedDate = date.Value;
            }
        }
Exemple #21
0
 private void DateDisplay_LostFocus(object sender, RoutedEventArgs e)
 {
     DateDisplay.Text = SelectedDate.ToString(DateFormat, CultureInfo.CurrentCulture);
     // When the user selects a field again, then the box loses focus, then
     // the user clicks the same field again, the selection is cleared,
     // causing the arrows not to appear. To fix, clear selection in advance.
     try
     {
         DateDisplay.SelectionLength = 0;
     }
     catch (NullReferenceException)
     {
     }
 }
Exemple #22
0
        /// <summary>
        /// 确认
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnConform_Click(object sender, RoutedEventArgs e)
        {
            if (calendar.SelectedDate == null)
            {
                calendar.SelectedDate = DateTime.Now;
            }

            if (SpecialMode)
            {
                //组装时间
                DateTime selectData = DateTime.Parse(calendar.SelectedDate.ToString());
                DateTime dt         = new DateTime(selectData.Year, selectData.Month, selectData.Day,
                                                   int.Parse(string.IsNullOrEmpty(this.tbHourSpecial.Text) ? DateTime.Now.Hour.ToString() : this.tbHourSpecial.Text),
                                                   int.Parse(string.IsNullOrEmpty(this.tbMinuteSpecial.Text) ? DateTime.Now.Minute.ToString() : this.tbMinuteSpecial.Text),
                                                   0);
                //通知
                SelectedDate = dt;
            }
            else
            {
                //组装时间
                DateTime selectData = DateTime.Parse(calendar.SelectedDate.ToString());
                DateTime dt         = new DateTime(selectData.Year, selectData.Month, selectData.Day,
                                                   int.Parse(string.IsNullOrEmpty(this.tbHour.Text) ? DateTime.Now.Hour.ToString() : this.tbHour.Text),
                                                   int.Parse(string.IsNullOrEmpty(this.tbMinute.Text) ? DateTime.Now.Minute.ToString() : this.tbMinute.Text),
                                                   int.Parse(string.IsNullOrEmpty(this.tbSecond.Text) ? DateTime.Now.Second.ToString() : this.tbSecond.Text));
                //通知
                SelectedDate = dt;
                //在文本框上显示
                this.tbInput.Text = dt.ToString(StringFormat);
            }

            gridMain.ToolTip = DateTime.Parse(SelectedDate.ToString()).ToString("yyyy-MM-dd HH:mm");

            this.popup.IsOpen    = false;
            this.popup.StaysOpen = false;

            if (SpecialMode)  //隐藏按钮和下划线
            {
                this.imgCancle.Visibility = Visibility.Hidden;
                this.tbHourSpecial.SetValue(ControlAttachProperty.ShowUnderlineProperty, false);
                this.tbMinuteSpecial.SetValue(ControlAttachProperty.ShowUnderlineProperty, false);
            }

            //触发回掉命令
            if (Command != null)
            {
                Command.Execute(CommandParameter);
            }
        }
Exemple #23
0
 public void SaveChanges()
 {
     if (!String.IsNullOrEmpty(InputName) ||
         !String.IsNullOrEmpty(InputSurname) ||
         !String.IsNullOrEmpty(SelectedDate.ToString()))
     {
         if (SelectedGender == Genders[0] || SelectedGender == null)
         {
             string message         = "You need to select gender.";
             var    exceptionWindow = new ExceptionWindow(message);
             exceptionWindow.ShowDialog();
         }
         else if (SelectedRole == Roles[0] || SelectedRole == null)
         {
             string message         = "You need to select role.";
             var    exceptionWindow = new ExceptionWindow(message);
             exceptionWindow.ShowDialog();
         }
         else
         {
             if (_currentEmployee == null)
             {
                 _currentEmployee = new Employee()
                 {
                     Name             = InputName,
                     Surname          = InputSurname,
                     Gender           = SelectedGender,
                     Role             = SelectedRole,
                     DateOfEmployment = SelectedDate
                 };
             }
             else
             {
                 _currentEmployee.Name             = InputName;
                 _currentEmployee.Surname          = InputSurname;
                 _currentEmployee.Gender           = SelectedGender;
                 _currentEmployee.Role             = SelectedRole;
                 _currentEmployee.DateOfEmployment = SelectedDate;
             }
             context.SaveChanges();
         }
     }
     else
     {
         string message         = "You need to complete all the fields.";
         var    exceptionWindow = new ExceptionWindow(message);
         exceptionWindow.ShowDialog();
     }
 }
Exemple #24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!string.IsNullOrEmpty(Request.Params["date"]))
                {
                    this.SelectedDate = Convert.ToDateTime(Request.QueryString["date"]);
                    if (!TimeSheetTicket.CanEdit(this.SelectedDate))
                    {
                        Redirect("Index.aspx");
                    }
                    if (SelectedDate.Date > DateTime.Now)
                    {
                        btnSubmit.Visible = false;
                    }
                }
                else
                {
                    this.SelectedDate = DateTime.Now;
                }
            }
            catch
            {
                this.SelectedDate = DateTime.Now;
            }
            if (!IsPostBack)
            {
                Title = "Write timesheet - " + SelectedDate.ToString("MM/dd/yyyy");

                List <CateGoryEntity> list = cgApp.GetCateGroyListByUserID(UserInfo.ID);
                if (list == null)
                {
                    list = new List <CateGoryEntity>();
                }
                var category = list.Select(x => new { category = x.Title, id = x.ID }).ToList();
                category.Insert(0, new { category = DefaulSelectText, id = 0 });
                this.CategoryJson = JsonConvert.SerializeObject(category, DoBase.DateConverter);

                List <ProjectDetailDTO> listProj = projApp.GetUserProjects(UserInfo);
                if (listProj != null && listProj.Count > 0)
                {
                    listProj.RemoveAll(r => r.Status == ProjectStatus.Cancelled || r.Status == ProjectStatus.Completed);
                }
                var project = listProj.Select(x => new { title = x.Title, id = x.ProjectID, tickets = new List <int>() }).ToList();
                project.Insert(0, new { title = DefaulSelectText, id = 0, tickets = new List <int>() });
                this.ProjectJson = JsonConvert.SerializeObject(project, DoBase.DateConverter);
            }
            totalQWeeklyHours = tsApp.TotalWeeklyHours(this.SelectedDate, UserInfo.ID);
        }
Exemple #25
0
        void DateSelector_Loaded(object sender, RoutedEventArgs e)
        {
            this.FocusableChanged += DateSelector_FocusableChanged;
            //对DataGridCell的特殊处理
            DataGridCell dgc = GetParentObject <DataGridCell>(this, null);

            if (dgc != null)
            {
                dgc.Focusable = false;
            }

            //获取顶层空间
            DependencyObject topParent = GetTopLevelControl(this);
            UIElement        uiParent  = topParent as UIElement;

            if (uiParent != null)
            {
                //  uiParent.AddHandler(PreviewMouseLeftButtonDownEvent, new RoutedEventHandler(MouseClick));
            }

            if (SelectedDate != null && SelectedDate != DateTime.MinValue)
            {
                DateTime dtValue = DateTime.Parse(SelectedDate.ToString());
                this.tbHourSpecial.Text = dtValue.Hour.ToString().PadLeft(2, '0');
                if (this.tbHourSpecial.IsEnabled)
                {
                    this.tbHourSpecial.Focus();
                }
                this.tbMinuteSpecial.Text  = dtValue.Minute.ToString().PadLeft(2, '0');
                this.calendar.SelectedDate = dtValue;
                this.gridMain.ToolTip      = dtValue.ToString("yyyy-MM-dd HH:mm");
            }
            else
            {
                if (!IsDefaultValue && SelectedDate == DateTime.MinValue)
                {
                    SelectedDate = null;
                    this.Dispatcher.BeginInvoke((Action) delegate
                    {
                        tbHourSpecial.Focus();
                    }, System.Windows.Threading.DispatcherPriority.ApplicationIdle);
                }
            }

            this.tbHourSpecial.MinWidth   = InputTextWidth;
            this.tbMinuteSpecial.MinWidth = InputTextWidth;

            controlLoaded = true;
        }
        private async Task ShowReceipts(string invoiceNo, ReceiptOrder receiptOrder)
        {
            try
            {
                DateToShow = SelectedDate.ToString("dddd MMM dd, yyyy");
                log.Debug("ReprintReceiptViewModel: Trying to fetch receipt data.");
                ReceiptData = await GetReceipts(invoiceNo, receiptOrder);

                SetMaximumAndMinimumInvoiceNo();
            }
            catch (Exception ex)
            {
                log.ErrorException(string.Format("ReprintReceiptViewModel: Exception:{0}", ex.Message), ex);
            }
        }
Exemple #27
0
        private async void ExecuteSaveMood()
        {
            if (Form.Description == null || Form.Hightlights == null)
            {
                _userDialogs.Toast("Please fill all the fields", TimeSpan.FromSeconds(3));
                return;
            }

            Form.Date = SelectedDate.ToString("yyyy-MM-dd");
            var response = await _apiManager.PostMood(Config.Token, Form);

            if (response.IsSuccessStatusCode)
            {
                await _navigationService.GoBackAsync();
            }
        }
        private void CheckForStringShortcuts()
        {
            if (OutputName.Contains("{D}"))
            {
                OutputName = OutputName.Replace("{D}", SelectedDate.ToString("M-d-yy"));
            }

            if (OutputName.Contains("{C}"))
            {
                OutputName = OutputName.Replace("{C}", SelectedContract.ContractNumber.ToString());
            }

            if (OutputName.Contains("{N}"))
            {
                OutputName = OutputName.Replace("{N}", SelectedContract.ContractName);
            }
        }
Exemple #29
0
        public async Task GetPatientsFromServer()
        {
            var wbed = 0;

            try
            {
                if (SelectedWard == null)
                {
                    return;
                }

                IsPageEnabled = true;
                string format = SelectedDate.ToString("dd-MM-yyyy", CultureInfo.InvariantCulture);
                wbed = SelectedBed != null ? SelectedBed.ID : 0;
                var patientsData = await _patientManager.GetPatientsByWardBed(format, SelectedWard.ID, wbed);

                if (!patientsData.Any())
                {
                    IsPageEnabled = false;
                    DependencyService.Get <INotify>().ShowToast("No patient found!!");
                    return;
                }

                foreach (var patient in patientsData)
                {
                    patient.ward_bed = $"{patient.ward_name}-{patient.bed_name}";
                    if (patient.is_care_giver)
                    {
                        patient.Patientname = $"{patient.Patientname} (Care Giver {patient.caregiverno})";
                    }
                    patient.Therapeutic_Condition = string.IsNullOrEmpty(patient.Therapeutic_Condition) ? "NA" : patient.Therapeutic_Condition;
                }

                var list = patientsData.OrderBy(x => x.bed_no);
                Patients = new ObservableCollection <mstr_patient_info>(list);

                IsPageEnabled = false;
            }
            catch (Exception ex)
            {
                IsPageEnabled = false;
                await PageDialog.DisplayAlertAsync("Alert!!", ex.Message, "OK");
            }
        }
Exemple #30
0
        private void SendEmailToHr()
        {
            string contentTemplete = FileHelper.GetEmailTemplate("TimehseetNoticeToHR.txt");
            string from            = Config.DefaultSendEmail;
            string to      = Config.NoSubmittedEmailAddrs;
            string subject = string.Format("Timesheet Submit Status Reminder - {0}", UserInfo.FirstAndLastName);
            string content = string.Empty;

            if (!string.IsNullOrEmpty(contentTemplete.Trim()))
            {
                content = contentTemplete.Trim().Replace("{Firstname}", UserInfo.FirstName)
                          .Replace("{Lastname}", UserInfo.LastName)
                          .Replace("{Date}", SelectedDate.ToString("MM/dd/yyyy"))
                          .Replace("{EmailDate}", DateTime.Now.ToString("MM/dd/yyyy"));
            }
            IEmailSender sender = ObjectFactory.GetInstance <IEmailSender>();

            sender.SendMail(to, from, subject, content);
        }