private async Task FillData(View view) { _vacationsViewModel = FactorySingleton.Factory.Get <VacationsViewModel>(); _vacationInfo = await _vacationsViewModel.CreateDraftVacationInfo(); view.FindViewById <TextView>(Resource.Id.ItemEmployee).Text = _vacationInfo.Employee.FullName; view.FindViewById <TextView>(Resource.Id.ItemApprover).Text = _vacationInfo.Approver.FullName; view.FindViewById <TextView>(Resource.Id.ItemDuration).Text = String.Format("{0} {1}", ConverterHelper.CalculateDuration(DateTime.Now.Date, DateTime.Now.Date), _vacationsViewModel.Localaizer.Localize("days")); view.FindViewById <TextView>(Resource.Id.ItemStatus).Text = _vacationInfo.Status.Value; view.FindViewById <TextView>(Resource.Id.ItemEmployee).Typeface = FontLoader.GetFontNormal((Activity)_container.Context); view.FindViewById <TextView>(Resource.Id.ItemType).Typeface = FontLoader.GetFontNormal((Activity)_container.Context); view.FindViewById <TextView>(Resource.Id.ItemApprover).Typeface = FontLoader.GetFontNormal((Activity)_container.Context); view.FindViewById <Button>(Resource.Id.ItemStartDateBtn).Typeface = FontLoader.GetFontNormal((Activity)_container.Context); view.FindViewById <Button>(Resource.Id.ItemEndDateBtn).Typeface = FontLoader.GetFontNormal((Activity)_container.Context); view.FindViewById <TextView>(Resource.Id.ItemDuration).Typeface = FontLoader.GetFontNormal((Activity)_container.Context); view.FindViewById <TextView>(Resource.Id.ItemStatus).Typeface = FontLoader.GetFontNormal((Activity)_container.Context); view.FindViewById <TextView>(Resource.Id.ItemError).Typeface = FontLoader.GetFontNormal((Activity)_container.Context); view.FindViewById <Button>(Resource.Id.ItemPickImageFromGallery).Typeface = FontLoader.GetFontNormal((Activity)_container.Context); view.FindViewById <Button>(Resource.Id.ItemPickImageFromCamera).Typeface = FontLoader.GetFontNormal((Activity)_container.Context); view.FindViewById <TextView>(Resource.Id.LabelEmployee).Typeface = FontLoader.GetFontBold((Activity)_container.Context); view.FindViewById <TextView>(Resource.Id.LabelType).Typeface = FontLoader.GetFontBold((Activity)_container.Context); view.FindViewById <TextView>(Resource.Id.LabelApprover).Typeface = FontLoader.GetFontBold((Activity)_container.Context); view.FindViewById <TextView>(Resource.Id.LabelDuration).Typeface = FontLoader.GetFontBold((Activity)_container.Context); view.FindViewById <TextView>(Resource.Id.LabelStatus).Typeface = FontLoader.GetFontBold((Activity)_container.Context); view.FindViewById <TextView>(Resource.Id.LabelAttachment).Typeface = FontLoader.GetFontBold((Activity)_container.Context); }
public async Task IntegrationCreateVacation() { VacationsViewModel vacationsViewModel = (onlineMode) ? FactorySingleton.Factory.Get <VacationsViewModel>() : FactorySingleton.FactoryOffline.Get <VacationsViewModel>(); List <VTSModel> vtsList = await vacationsViewModel.GetVTSList(); Assert.IsNotNull(vtsList, "Message: GetVTSList error"); VacationInfoModel vacationInfo = await vacationsViewModel.GetVacationInfo(vtsList[0].Id); Assert.IsNotNull(vacationInfo, "Message: GetVacationInfo error"); var oldcount = vtsList.Count; VacationInfoModel vacationInfoNew = await vacationsViewModel.CreateDraftVacationInfo(); Assert.IsNotNull(vacationInfoNew, "Message: CreateDraftVacationInfo error"); vacationInfoNew.Type.Value = "TESTING"; await vacationsViewModel.UpdateDraftVacationInfo(vacationInfoNew); if (onlineMode) { Assert.IsTrue((await vacationsViewModel.SendDraftVacationInfo()), "Message: error SendDraftVacationInfo"); vtsList = await vacationsViewModel.GetVTSList(); Assert.AreEqual(vtsList.Count, (oldcount + 1), "Message: error after Create newcount != oldcount + 1"); VacationInfoModel vacationInfoSaved = await vacationsViewModel.GetVacationInfo(vtsList[vtsList.Count - 1].Id); Assert.IsNotNull(vacationInfoSaved, "Message: GetVacationInfo2 error"); Assert.AreEqual(vacationInfoNew.Type.Value, vacationInfoSaved.Type.Value, "Message: error vacationInfoNew not Equals Type.Value vacationInfoSaved"); } }
protected async override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); RequestWindowFeature(WindowFeatures.ActionBar); ActionBar.SetDisplayHomeAsUpEnabled(true); ActionBar.SetHomeButtonEnabled(true); SetContentView(Resource.Layout.CreateScreen); _vacationsViewModel = FactorySingleton.Factory.Get <VacationsViewModel>(); if (_vacationsViewModel.IsOnlineMode) { ActionBar.SetTitle(Resource.String.newRequest); } else { ActionBar.SetTitle(Resource.String.newRequestOffline); } _vacationInfo = await _vacationsViewModel.CreateDraftVacationInfo(); if (_vacationInfo == null) { Intent myIntent = new Intent(this, typeof(MainScreenActivity)); SetResult(Result.Canceled, myIntent); Exit(); return; } if (Intent.Extras != null) { _typevacation = Intent.Extras.GetInt("typevacation"); switch (_typevacation) { case VACATION_REQUEST: { _vacationInfo.Type.Key = "VAC"; _vacationInfo.Type.Value = "Regular (VAC)"; break; } case SICK_REQUEST: { _vacationInfo.Type.Key = "ILL"; _vacationInfo.Type.Value = "Illness (ILL)"; break; } case OVERTIME_REQUEST: { _vacationInfo.Type.Key = "OVT"; _vacationInfo.Type.Value = "Overtime (OVT)"; break; } case LIVEWOP_REQUEST: { _vacationInfo.Type.Key = "POV"; _vacationInfo.Type.Value = "Without pay (POV)"; break; } case EXCEPTIONAL_REQUEST: { _vacationInfo.Type.Key = "EXV"; _vacationInfo.Type.Value = "EXCEPTIONAL (EXV)"; break; } } await _vacationsViewModel.UpdateDraftVacationInfo(_vacationInfo); } else { Finish(); } FragmentTransaction transaction = FragmentManager.BeginTransaction(); _fragment = new VacationTabsFragment(); transaction.Replace(Resource.Id.sample_content_fragment, _fragment); transaction.Commit(); }