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 TxtStartDate_Validating(object sender, CancelEventArgs e) { if (_Tag == "" || ActiveControl == TxtStartDate) { return; } if (TxtStartDate.Text != " / /") { try { if (ClsGlobal.CheckDateInsideCompanyPeriod(Convert.ToDateTime(TxtStartDate.Text)) == 1) { ClsGlobal.DateRangeMsg(); TxtStartDate.Focus(); } } catch { MessageBox.Show("Please enter valid date.", "Mr. Solutions", MessageBoxButtons.OK, MessageBoxIcon.Error); TxtStartDate.Focus(); } } else { ClsGlobal.DateRangeMsg(); TxtStartDate.Focus(); } }
private void TxtStartDate_Validating(object sender, CancelEventArgs e) { if (_Tag == "" || ActiveControl == TxtStartDate) { return; } if (TxtStartDate.Text.Trim() != "/ /") { int day; int month; day = Convert.ToInt32(Convert.ToString(TxtStartDate.Text).Substring(0, 2)); month = Convert.ToInt32(Convert.ToString(TxtStartDate.Text).Substring(3, 2)); if (day > 32 || day < 1) { MessageBox.Show("Please Enter Valid Day !", "Info.", MessageBoxButtons.OK, MessageBoxIcon.Information); TxtStartDate.Focus(); return; } else if (month > 12 || month < 1) { MessageBox.Show("Please Enter Valid Month !", "Info.", MessageBoxButtons.OK, MessageBoxIcon.Information); TxtStartDate.Focus(); return; } } else { MessageBox.Show("Start date cannot be left blank.", "Info.", MessageBoxButtons.OK, MessageBoxIcon.Information); TxtStartDate.Focus(); return; } }
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); } }
/*************************************** * * This is where the UTILITY METHODS are. * ***************************************/ /// <summary> /// This clears the form after an entry is added. /// </summary> private void ClearForm() { TxtEmpID.Clear(); TxtFirstName.Clear(); TxtLastName.Clear(); TxtMiddleName.Clear(); TxtXtraProp1.Clear(); TxtXtraProp2.Clear(); CkbActiveEmployee.Checked = true; CkbBenefits.Checked = true; CkbApproved.Checked = true; LVxCourses.Items.Clear(); TxtCourseID.Clear(); TxtGrade.Clear(); TxtDescription.Clear(); TxtDateApproved.Clear(); TxtCredits.Clear(); TxtMaritalStatus.Clear(); TxtDepartment.Clear(); TxtTitle.Clear(); TxtStartDate.Clear(); }
protected void BtnSave_Click(object sender, EventArgs e) { try { if (TxtCompName.Text.Length == 0) { //LblMsg.Text = "Company Name Is Blank, Enter Valid Company Name...."; TxtCompName.Focus(); return; } if (TxtStartDate.Text.Length == 0) { //LblMsg.Text = "Start Date Is Blank, Enter Valid Start Date...."; TxtStartDate.Focus(); return; } if (TxtMobNo.Text.Length == 0) { //LblMsg.Text = "Mob.No Is Blank, Enter Valid Mob.No...."; TxtMobNo.Focus(); return; } if (TxtEMailId.Text.Length == 0) { // LblMsg.Text = "Email Id Is Blank, Enter Valid Email Id...."; TxtEMailId.Focus(); return; } StrSql = new StringBuilder(); StrSql.Length = 0; if (HidFldId.Value.Length == 0) { StrSql.AppendLine("Insert Into Com_Mast (CompName,StartDate"); StrSql.AppendLine(",CountryId,StateId "); StrSql.AppendLine(",CityId,Address1,PinCode"); StrSql.AppendLine(",MobNo,Phone,EMailId"); StrSql.AppendLine(",WebSite"); StrSql.AppendLine(",Entry_Date,Entry_Time"); StrSql.AppendLine(",Entry_UID,UPDFLAG)"); StrSql.AppendLine("Values(@CompName,@StartDate"); StrSql.AppendLine(",@CountryId,@StateId "); StrSql.AppendLine(",@CityId,@Address1,@PinCode"); StrSql.AppendLine(",@MobNo,@Phone,@EMailId"); StrSql.AppendLine(",@WebSite"); StrSql.AppendLine(",GetDate(),Convert(VarChar,GetDate(),108)"); StrSql.AppendLine(",@Entry_UID,0)"); } else { StrSql.AppendLine("Update Com_Mast Set CompName=@CompName,StartDate=@StartDate"); StrSql.AppendLine(",CountryId=@CountryId,StateId=@StateId "); StrSql.AppendLine(",CityId=@CityId,Address1=@Address1,PinCode=@PinCode"); StrSql.AppendLine(",MobNo=@MobNo,Phone=@Phone,EMailId=@EMailId"); StrSql.AppendLine(",WebSite=@WebSite"); StrSql.AppendLine(",MEntry_Date=GetDate(),MEntry_Time=Convert(Varchar,GetDate(),108)"); StrSql.AppendLine(",MEntry_UID=@Entry_UID,UPDFLAG=IsNull(UPDFlag,0)+1"); StrSql.AppendLine("Where Id=@Id"); } Cmd = new SqlCommand(StrSql.ToString(), SqlFunc.gConn); Cmd.Parameters.AddWithValue("@CompName", TxtCompName.Text.Trim()); Cmd.Parameters.AddWithValue("@StartDate", ValueConvert.ConvertDate(TxtStartDate.Text)); if (ddlCountry.SelectedValue != "0") { Cmd.Parameters.AddWithValue("@CountryId", ddlCountry.SelectedValue); } else { Cmd.Parameters.AddWithValue("@CountryId", DBNull.Value); } if (ddlState.SelectedValue != "0") { Cmd.Parameters.AddWithValue("@StateId", ddlState.SelectedValue); } else { Cmd.Parameters.AddWithValue("@StateId", DBNull.Value); } if (ddlCity.SelectedValue != "0") { Cmd.Parameters.AddWithValue("@CityId", ddlCity.SelectedValue); } else { Cmd.Parameters.AddWithValue("@CityId", DBNull.Value); } Cmd.Parameters.AddWithValue("@Address1", TxtAddress1.Text.Trim()); Cmd.Parameters.AddWithValue("@PinCode", TxtPinCode.Text.Trim()); Cmd.Parameters.AddWithValue("@MobNo", TxtMobNo.Text.Trim()); Cmd.Parameters.AddWithValue("@Phone", TxtPhone.Text.Trim()); Cmd.Parameters.AddWithValue("@WebSite", TxtWebSite.Text.Trim()); Cmd.Parameters.AddWithValue("@EMailId", TxtEMailId.Text.Trim()); Cmd.Parameters.AddWithValue("@Entry_UID", HidFldUID.Value.ToString()); if (HidFldId.Value.Length == 0) { SqlFunc.ExecuteNonQuery(Cmd); LblMsg.Text = "Company added successfully"; } else { Cmd.Parameters.AddWithValue("@ID", HidFldId.Value.ToString()); SqlFunc.ExecuteNonQuery(Cmd); LblMsg.Text = "Company updated successfully"; } FillGrid(); ClearAll(); MyMenu.Items[0].Selected = true; MyMenu.Items[0].ImageUrl = "~/Images/ViewEnable.jpg"; MyMultiView.ActiveViewIndex = 0; MyMenu.Items[1].ImageUrl = "~/Images/NewOrEditDisable.jpg"; } catch (Exception ex) { Response.Write(ex); } }
/*************************************** * * This is where the EMPLOYEE DATA METHODS are. * ***************************************/ /// <summary> /// This will check the shared values for all employee fields /// </summary> /// <param name="creatingEmployee"> This is the employee that needs to be saved.</param> /// <returns></returns> private bool CheckBaseValues(Employee creatingEmployee) { uint tempUint = 0; if (uint.TryParse(TxtEmpID.Text, out tempUint)) { creatingEmployee.EmpID = tempUint; } else { LblStatus.Text = errorMessageUint; TxtEmpID.Focus(); return(false); } if (TxtLastName.Text == "") { LblStatus.Text = "Last name cannot be empty."; TxtLastName.Focus(); return(false); } if (TxtFirstName.Text == "") { LblStatus.Text = "First name cannot be empty."; TxtFirstName.Focus(); return(false); } if (TxtMaritalStatus.Text == "") { LblStatus.Text = "Marital Status cannont be empty."; TxtMaritalStatus.Focus(); return(false); } if (TxtDepartment.Text == "") { LblStatus.Text = "Department cannont be empty."; TxtDepartment.Focus(); return(false); } if (TxtTitle.Text == "") { LblStatus.Text = "Title cannot be emtpy."; TxtTitle.Focus(); return(false); } if (TxtStartDate.Text == "") { LblStatus.Text = "Start Date cannot be empty."; TxtStartDate.Focus(); return(false); } /* * //Middle Name Not required. * if (TxtMiddleName.Text == "") * { * LblStatus.Text = "Middle name cannot be empty."; * TxtMiddleName.Focus(); * return false; * } */ creatingEmployee.EmpType = CbxEmployeeType.Text; creatingEmployee.FirstName = TxtFirstName.Text; creatingEmployee.LastName = TxtLastName.Text; creatingEmployee.MiddleName = TxtMiddleName.Text; creatingEmployee.MaritalStatus = TxtMaritalStatus.Text; creatingEmployee.Department = TxtDepartment.Text; creatingEmployee.Title = TxtTitle.Text; creatingEmployee.StartDate = TxtStartDate.Text; if (CkbBenefits.Checked) { creatingEmployee.Benefits = true; } else { creatingEmployee.Benefits = false; } if (CkbActiveEmployee.Checked) { creatingEmployee.ActiveEmployee = true; } else { creatingEmployee.ActiveEmployee = false; } return(true); }