private void TxtEndDate_Validating(object sender, CancelEventArgs e) { if (_Tag == "" || ActiveControl == TxtEndDate) { return; } if (TxtEndDate.Text != " / /") { try { if (ClsGlobal.CheckDateInsideCompanyPeriod(Convert.ToDateTime(TxtEndDate.Text)) == 1) { ClsGlobal.DateRangeMsg(); TxtEndDate.Focus(); } } catch { MessageBox.Show("Please enter valid date.", "Mr. Solutions", MessageBoxButtons.OK, MessageBoxIcon.Error); TxtEndDate.Focus(); } } else { ClsGlobal.DateRangeMsg(); TxtEndDate.Focus(); } }
protected override void OnCreate(Bundle savedInstanceState) { try { base.OnCreate(savedInstanceState); IMethods.IApp.FullScreenApp(this); var view = MyContextWrapper.GetContentView(this, Settings.Lang, Resource.Layout.CreateEvent_Layout); if (view != null) { SetContentView(view); } else { SetContentView(Resource.Layout.CreateEvent_Layout); } var ToolBar = FindViewById <Toolbar>(Resource.Id.toolbar); if (ToolBar != null) { ToolBar.Title = GetText(Resource.String.Lbl_Create_Events); SetSupportActionBar(ToolBar); SupportActionBar.SetDisplayShowCustomEnabled(true); SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetHomeButtonEnabled(true); SupportActionBar.SetDisplayShowHomeEnabled(true); } TxtEventName = FindViewById <EditText>(Resource.Id.eventname); IconStartDate = FindViewById <TextView>(Resource.Id.StartIcondate); TxtStartDate = FindViewById <EditText>(Resource.Id.StartDateTextview); TxtStartTime = FindViewById <EditText>(Resource.Id.StartTimeTextview); IconEndDate = FindViewById <TextView>(Resource.Id.EndIcondate); TxtEndDate = FindViewById <EditText>(Resource.Id.EndDateTextview); TxtEndTime = FindViewById <EditText>(Resource.Id.EndTimeTextview); IconLocation = FindViewById <TextView>(Resource.Id.IconLocation); TxtLocation = FindViewById <EditText>(Resource.Id.LocationTextview); TxtDescription = FindViewById <EditText>(Resource.Id.description); ImageEvent = FindViewById <ImageViewAsync>(Resource.Id.EventCover); BtnImage = FindViewById <Button>(Resource.Id.btn_selectimage); Txt_Add = FindViewById <TextView>(Resource.Id.toolbar_title); IMethods.Set_TextViewIcon("1", IconStartDate, IonIcons_Fonts.AndroidTime); IMethods.Set_TextViewIcon("1", IconEndDate, IonIcons_Fonts.AndroidTime); IMethods.Set_TextViewIcon("1", IconLocation, IonIcons_Fonts.Location); TxtStartTime.SetOnClickListener(this); TxtEndTime.SetOnClickListener(this); TxtStartDate.SetOnClickListener(this); TxtEndDate.SetOnClickListener(this); } catch (Exception e) { Crashes.TrackError(e); } }
private void InitComponent() { try { TxtEventName = FindViewById <EditText>(Resource.Id.eventname); IconStartDate = FindViewById <TextView>(Resource.Id.StartIcondate); TxtStartDate = FindViewById <EditText>(Resource.Id.StartDateTextview); TxtStartTime = FindViewById <EditText>(Resource.Id.StartTimeTextview); IconEndDate = FindViewById <TextView>(Resource.Id.EndIcondate); TxtEndDate = FindViewById <EditText>(Resource.Id.EndDateTextview); TxtEndTime = FindViewById <EditText>(Resource.Id.EndTimeTextview); IconLocation = FindViewById <TextView>(Resource.Id.IconLocation); TxtLocation = FindViewById <EditText>(Resource.Id.LocationTextview); TxtDescription = FindViewById <EditText>(Resource.Id.description); ImageEvent = FindViewById <ImageView>(Resource.Id.EventCover); BtnImage = FindViewById <Button>(Resource.Id.btn_selectimage); TxtAdd = FindViewById <TextView>(Resource.Id.toolbar_title); TxtAdd.Text = GetText(Resource.String.Lbl_Save); FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, IconStartDate, IonIconsFonts.AndroidTime); FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, IconEndDate, IonIconsFonts.AndroidTime); FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, IconLocation, IonIconsFonts.Location); Methods.SetColorEditText(TxtEventName, AppSettings.SetTabDarkTheme ? Color.White : Color.Black); Methods.SetColorEditText(TxtStartDate, AppSettings.SetTabDarkTheme ? Color.White : Color.Black); Methods.SetColorEditText(TxtStartTime, AppSettings.SetTabDarkTheme ? Color.White : Color.Black); Methods.SetColorEditText(TxtEndDate, AppSettings.SetTabDarkTheme ? Color.White : Color.Black); Methods.SetColorEditText(TxtEndTime, AppSettings.SetTabDarkTheme ? Color.White : Color.Black); Methods.SetColorEditText(TxtLocation, AppSettings.SetTabDarkTheme ? Color.White : Color.Black); Methods.SetColorEditText(TxtDescription, AppSettings.SetTabDarkTheme ? Color.White : Color.Black); TxtStartTime.SetOnClickListener(this); TxtEndTime.SetOnClickListener(this); TxtStartDate.SetOnClickListener(this); TxtEndDate.SetOnClickListener(this); PublisherAdView = FindViewById <PublisherAdView>(Resource.Id.multiple_ad_sizes_view); AdsGoogle.InitPublisherAdView(PublisherAdView); } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }
private void InitComponent() { try { TxtEventName = FindViewById <EditText>(Resource.Id.eventname); IconStartDate = FindViewById <TextView>(Resource.Id.StartIcondate); TxtStartDate = FindViewById <EditText>(Resource.Id.StartDateTextview); TxtStartTime = FindViewById <EditText>(Resource.Id.StartTimeTextview); IconEndDate = FindViewById <TextView>(Resource.Id.EndIcondate); TxtEndDate = FindViewById <EditText>(Resource.Id.EndDateTextview); TxtEndTime = FindViewById <EditText>(Resource.Id.EndTimeTextview); IconLocation = FindViewById <TextView>(Resource.Id.IconLocation); TxtLocation = FindViewById <EditText>(Resource.Id.LocationTextview); TxtDescription = FindViewById <EditText>(Resource.Id.description); ImageEvent = FindViewById <ImageView>(Resource.Id.EventCover); BtnImage = FindViewById <Button>(Resource.Id.btn_selectimage); TxtAdd = FindViewById <TextView>(Resource.Id.toolbar_title); FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, IconStartDate, IonIconsFonts.AndroidTime); FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, IconEndDate, IonIconsFonts.AndroidTime); FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, IconLocation, IonIconsFonts.Location); Methods.SetColorEditText(TxtEventName, AppSettings.SetTabDarkTheme ? Color.White : Color.Black); Methods.SetColorEditText(TxtStartTime, AppSettings.SetTabDarkTheme ? Color.White : Color.Black); Methods.SetColorEditText(TxtStartDate, AppSettings.SetTabDarkTheme ? Color.White : Color.Black); Methods.SetColorEditText(TxtEndDate, AppSettings.SetTabDarkTheme ? Color.White : Color.Black); Methods.SetColorEditText(TxtEndTime, AppSettings.SetTabDarkTheme ? Color.White : Color.Black); Methods.SetColorEditText(TxtLocation, AppSettings.SetTabDarkTheme ? Color.White : Color.Black); Methods.SetColorEditText(TxtDescription, AppSettings.SetTabDarkTheme ? Color.White : Color.Black); TxtStartTime.SetOnClickListener(this); TxtEndTime.SetOnClickListener(this); TxtStartDate.SetOnClickListener(this); TxtEndDate.SetOnClickListener(this); } catch (Exception e) { Console.WriteLine(e); } }
private void TxtEndDate_Validating(object sender, CancelEventArgs e) { if (_Tag == "" || ActiveControl == TxtEndDate) { return; } if (TxtEndDate.Text.Trim() != "/ /") { int day; int month; day = Convert.ToInt32(Convert.ToString(TxtEndDate.Text).Substring(0, 2)); month = Convert.ToInt32(Convert.ToString(TxtEndDate.Text).Substring(3, 2)); if (day > 32 || day < 1) { MessageBox.Show("Please Enter Valid Day !", "Info.", MessageBoxButtons.OK, MessageBoxIcon.Information); TxtEndDate.Focus(); return; } else if (month > 12 || month < 1) { MessageBox.Show("Please Enter Valid Month !", "Info.", MessageBoxButtons.OK, MessageBoxIcon.Information); TxtEndDate.Focus(); return; } else if (Convert.ToDateTime(TxtEndDate.Text) < Convert.ToDateTime(TxtStartDate.Text)) { MessageBox.Show("End Date Cannot be less then Start Date !", "Info.", MessageBoxButtons.OK, MessageBoxIcon.Information); TxtEndDate.Focus(); return; } } else { MessageBox.Show("Company Register Date Cannot be Left Blank!"); TxtEndDate.Focus(); return; } //string fyStart = TxtStartDate.Text.Substring(6, 4); //string fyEnd = TxtEndDate.Text.Substring(6, 4); //TxtFiscalYear.Text = fyStart + "." + fyEnd; }