//format add user query and select using teacherID stored on login and auto increment of stuID public void ActivateAdd() { //check to see if neccesary variables were received if (user && first && last && grad) { //check if username is already taken again CheckUsername.updateUserList(); if (!(CheckUsername.IsTaken(four))) { //direct db connection to where the db is stored in app //and open connection const String connectionString = "URI=file:Assets\\Plugins\\MumboJumbos.db"; IDbConnection dbcon = new SqliteConnection(connectionString); dbcon.Open(); //create query for adding user IDbCommand dbcmd = dbcon.CreateCommand(); String command = "INSERT INTO student " + "(TeacherID, StuUserName, FirstName, LastName, Grade) " + "VALUES (@two, @three, @four, @five, @six)"; //dbcmd.Parameters.Add(new SqliteParameter("@one", one)); dbcmd.Parameters.Add(new SqliteParameter("@two", two)); dbcmd.Parameters.Add(new SqliteParameter("@three", three)); dbcmd.Parameters.Add(new SqliteParameter("@four", four)); dbcmd.Parameters.Add(new SqliteParameter("@five", five)); dbcmd.Parameters.Add(new SqliteParameter("@six", six)); dbcmd.CommandText = command; IDataReader reader = dbcmd.ExecuteReader(); addedText.text = "User Added!"; addedText.enabled = true; CheckUsername.updateUserList(); LastName.text = ""; Grade.text = ""; FirstName.text = ""; StudentUserName.text = ""; } else { SceneManager.LoadScene("AddUser"); //Reset(); } } else { SceneManager.LoadScene("AddUser"); Reset(); } }
//format add user query and select using teacherID stored on login and auto increment of stuID public void ActivateAdd() { //check to see if neccesary variables were received if (first) { //check if username is already taken again if (!(CheckUsername.IsTaken(four))) { //direct db connection to where the db is stored in app //and open connection const string connectionString = "URI=file:Assets\\Plugins\\MumboJumbos.db"; IDbConnection dbcon = new SqliteConnection(connectionString); dbcon.Open(); //create query for adding user IDbCommand dbcmd = dbcon.CreateCommand(); String command = "INSERT INTO wordlist " + "(SetID, Word, Difficulty, TeacherID, Grade) " + "VALUES (@two, @three, @four, @five, @six)"; //dbcmd.Parameters.Add(new SqliteParameter("@one", one)); dbcmd.Parameters.Add(new SqliteParameter("@two", three)); dbcmd.Parameters.Add(new SqliteParameter("@three", four)); dbcmd.Parameters.Add(new SqliteParameter("@four", five)); dbcmd.Parameters.Add(new SqliteParameter("@five", SubmitName.getTeachID())); dbcmd.Parameters.Add(new SqliteParameter("@six", six)); string sql = command; dbcmd.CommandText = sql; IDataReader reader = dbcmd.ExecuteReader(); addedText.text = "Word Added!"; addedText.enabled = true; SetID.text = null; Word.text = null; Difficulty.text = null; Grade.text = null; } else { SceneManager.LoadScene("AddWord"); Reset(); } } else { SceneManager.LoadScene("AddWord"); Reset(); } }
public override void ViewDidLoad() { try { base.ViewDidLoad(); Images.SetTitle(LangEnglish.Images, UIControlState.Normal); ImagesProgressText.Text = ""; DescriptionLabel.Text = LangEnglish.Description; SexLabel.Text = LangEnglish.EditSex; WomenLabel.Text = LangEnglish.Women; MenLabel.Text = LangEnglish.Men; AccountData.SetTitle(LangEnglish.EditAccountData, UIControlState.Normal); ChangePassword.SetTitle(LangEnglish.EditChangePassword, UIControlState.Normal); LocationSettings.SetTitle(LangEnglish.EditLocationSettings, UIControlState.Normal); Save.SetTitle(LangEnglish.EditSave, UIControlState.Normal); Cancel.SetTitle(LangEnglish.Cancel, UIControlState.Normal); MoreOptions.SetTitle(LangEnglish.EditMoreOptions, UIControlState.Normal); EmailLabel.Text = LangEnglish.Email; UsernameLabel.Text = LangEnglish.Username; CheckUsername.SetTitle(LangEnglish.CheckAvailability, UIControlState.Normal); NameLabel.Text = LangEnglish.Name; OldPasswordLabel.Text = LangEnglish.EditOldPassword; NewPasswordLabel.Text = LangEnglish.EditNewPassword; ConfirmPasswordLabel.Text = LangEnglish.EditConfirmPassword; UseLocationLabel.Text = LangEnglish.UseLocation; LocationShareLabel.Text = LangEnglish.LocationShare; LocationShareAllLabel.Text = LangEnglish.LocationShareAll; LocationShareLikeLabel.Text = LangEnglish.LocationShareLike; LocationShareMatchLabel.Text = LangEnglish.LocationShareMatch; LocationShareFriendLabel.Text = LangEnglish.LocationShareFriend; LocationShareNoneLabel.Text = LangEnglish.LocationShareNone; DistanceShareLabel.Text = LangEnglish.DistanceShare; DistanceShareAllLabel.Text = LangEnglish.DistanceShareAll; DistanceShareLikeLabel.Text = LangEnglish.DistanceShareLike; DistanceShareMatchLabel.Text = LangEnglish.DistanceShareMatch; DistanceShareFriendLabel.Text = LangEnglish.DistanceShareFriend; DistanceShareNoneLabel.Text = LangEnglish.DistanceShareNone; ImageEditorLabel.Text = LangEnglish.ImageEditorLabel; DeactivateAccount.SetTitle(LangEnglish.DeactivateAccount, UIControlState.Normal); DeleteAccount.SetTitle(LangEnglish.DeleteAccount, UIControlState.Normal); DescriptionText.Delegate = this; Images.Layer.MasksToBounds = true; CheckUsername.Layer.MasksToBounds = true; Save.Layer.MasksToBounds = true; Cancel.Layer.MasksToBounds = true; DeactivateAccount.Layer.MasksToBounds = true; DeleteAccount.Layer.MasksToBounds = true; c.DrawBorder(DescriptionText); c.CollapseY(AccountDataSection); c.CollapseY(ChangePasswordSection); c.CollapseY(LocationSettingsSection); c.CollapseY(MoreOptionsSection); LoaderCircle.Hidden = true; ImageEditorFrameBorder.Layer.BorderColor = UIColor.FromName("PrimaryDark").CGColor; ImageEditorFrameBorder.Layer.BorderWidth = 1; rc = new RegisterCommonMethods(this, c, ImagesUploaded, Email, Username, Name, DescriptionText, CheckUsername, Images, ImagesProgressText, LoaderCircle, ImagesProgress, UseLocationSwitch, LocationShareAll, LocationShareLike, LocationShareMatch, LocationShareFriend, LocationShareNone, DistanceShareAll, DistanceShareLike, DistanceShareMatch, DistanceShareFriend, DistanceShareNone, ImageEditorControls, TopSeparator, RippleImageEditor, ImageEditorStatus, ImageEditorCancel, ImageEditorOK, ImageEditor, ImageEditorFrame, ImageEditorFrameBorder); c.AddViews(Snackbar, Snackbar.SnackText, Snackbar.SnackButton); ProfileEditScroll.SetContext(this); ImagesUploaded.SetContext(this); ImagesUploaded.numColumns = 3; //it does not get passed in the layout file ImagesUploaded.tileSpacing = 2; AccountData.TouchUpInside += AccountData_Click; ChangePassword.TouchUpInside += ChangePassword_Click; LocationSettings.TouchUpInside += LocationSettings_Click; Save.TouchUpInside += Save_Click; Cancel.TouchUpInside += Cancel_Click; MoreOptions.TouchUpInside += MoreOptions_Click; DeactivateAccount.TouchUpInside += DeactivateAccount_Click; DeleteAccount.TouchUpInside += DeleteAccount_Click; ImageEditorCancel.TouchUpInside += rc.CancelImageEditing; ImageEditorOK.TouchUpInside += rc.OKImageEditing; RoundBottom_Base = RoundBottom; Snackbar_Base = Snackbar; BottomConstraint_Base = BottomConstraint; SnackTopConstraint_Base = SnackTopConstraint; SnackBottomConstraint_Base = SnackBottomConstraint; ScrollBottomConstraint_Base = ScrollBottomConstraint; ScrollBottomOuterConstraint_Base = ScrollBottomOuterConstraint; ViewportConstraint_Base = ViewportConstraint; } catch (Exception ex) { c.ReportErrorSilent(ex.Message + Environment.NewLine + ex.StackTrace); } }
void ReleaseDesignerOutlets() { if (BottomConstraint != null) { BottomConstraint.Dispose(); BottomConstraint = null; } if (CheckUsername != null) { CheckUsername.Dispose(); CheckUsername = null; } if (ConfirmPassword != null) { ConfirmPassword.Dispose(); ConfirmPassword = null; } if (ConfirmPasswordLabel != null) { ConfirmPasswordLabel.Dispose(); ConfirmPasswordLabel = null; } if (DescriptionLabel != null) { DescriptionLabel.Dispose(); DescriptionLabel = null; } if (DescriptionText != null) { DescriptionText.Dispose(); DescriptionText = null; } if (DistanceShareAll != null) { DistanceShareAll.Dispose(); DistanceShareAll = null; } if (DistanceShareAllLabel != null) { DistanceShareAllLabel.Dispose(); DistanceShareAllLabel = null; } if (DistanceShareFriend != null) { DistanceShareFriend.Dispose(); DistanceShareFriend = null; } if (DistanceShareFriendLabel != null) { DistanceShareFriendLabel.Dispose(); DistanceShareFriendLabel = null; } if (DistanceShareLabel != null) { DistanceShareLabel.Dispose(); DistanceShareLabel = null; } if (DistanceShareLike != null) { DistanceShareLike.Dispose(); DistanceShareLike = null; } if (DistanceShareLikeLabel != null) { DistanceShareLikeLabel.Dispose(); DistanceShareLikeLabel = null; } if (DistanceShareMatch != null) { DistanceShareMatch.Dispose(); DistanceShareMatch = null; } if (DistanceShareMatchLabel != null) { DistanceShareMatchLabel.Dispose(); DistanceShareMatchLabel = null; } if (DistanceShareNone != null) { DistanceShareNone.Dispose(); DistanceShareNone = null; } if (DistanceShareNoneLabel != null) { DistanceShareNoneLabel.Dispose(); DistanceShareNoneLabel = null; } if (Email != null) { Email.Dispose(); Email = null; } if (EmailExplanationLabel != null) { EmailExplanationLabel.Dispose(); EmailExplanationLabel = null; } if (EmailLabel != null) { EmailLabel.Dispose(); EmailLabel = null; } if (EulaLabel != null) { EulaLabel.Dispose(); EulaLabel = null; } if (EulaText != null) { EulaText.Dispose(); EulaText = null; } if (ImageEditor != null) { ImageEditor.Dispose(); ImageEditor = null; } if (ImageEditorCancel != null) { ImageEditorCancel.Dispose(); ImageEditorCancel = null; } if (ImageEditorControls != null) { ImageEditorControls.Dispose(); ImageEditorControls = null; } if (ImageEditorFrame != null) { ImageEditorFrame.Dispose(); ImageEditorFrame = null; } if (ImageEditorFrameBorder != null) { ImageEditorFrameBorder.Dispose(); ImageEditorFrameBorder = null; } if (ImageEditorLabel != null) { ImageEditorLabel.Dispose(); ImageEditorLabel = null; } if (ImageEditorOK != null) { ImageEditorOK.Dispose(); ImageEditorOK = null; } if (ImageEditorStatus != null) { ImageEditorStatus.Dispose(); ImageEditorStatus = null; } if (Images != null) { Images.Dispose(); Images = null; } if (ImagesProgress != null) { ImagesProgress.Dispose(); ImagesProgress = null; } if (ImagesProgressText != null) { ImagesProgressText.Dispose(); ImagesProgressText = null; } if (LoaderCircle != null) { LoaderCircle.Dispose(); LoaderCircle = null; } if (LocationExplanation != null) { LocationExplanation.Dispose(); LocationExplanation = null; } if (LocationShareAll != null) { LocationShareAll.Dispose(); LocationShareAll = null; } if (LocationShareAllLabel != null) { LocationShareAllLabel.Dispose(); LocationShareAllLabel = null; } if (LocationShareFriend != null) { LocationShareFriend.Dispose(); LocationShareFriend = null; } if (LocationShareFriendLabel != null) { LocationShareFriendLabel.Dispose(); LocationShareFriendLabel = null; } if (LocationShareLabel != null) { LocationShareLabel.Dispose(); LocationShareLabel = null; } if (LocationShareLike != null) { LocationShareLike.Dispose(); LocationShareLike = null; } if (LocationShareLikeLabel != null) { LocationShareLikeLabel.Dispose(); LocationShareLikeLabel = null; } if (LocationShareMatch != null) { LocationShareMatch.Dispose(); LocationShareMatch = null; } if (LocationShareMatchLabel != null) { LocationShareMatchLabel.Dispose(); LocationShareMatchLabel = null; } if (LocationShareNone != null) { LocationShareNone.Dispose(); LocationShareNone = null; } if (LocationShareNoneLabel != null) { LocationShareNoneLabel.Dispose(); LocationShareNoneLabel = null; } if (Name != null) { Name.Dispose(); Name = null; } if (NameLabel != null) { NameLabel.Dispose(); NameLabel = null; } if (Password != null) { Password.Dispose(); Password = null; } if (PasswordLabel != null) { PasswordLabel.Dispose(); PasswordLabel = null; } if (Register != null) { Register.Dispose(); Register = null; } if (Register_Scroll != null) { Register_Scroll.Dispose(); Register_Scroll = null; } if (RegisterCancel != null) { RegisterCancel.Dispose(); RegisterCancel = null; } if (RegisterImagesUploaded != null) { RegisterImagesUploaded.Dispose(); RegisterImagesUploaded = null; } if (Reset != null) { Reset.Dispose(); Reset = null; } if (RippleImageEditor != null) { RippleImageEditor.Dispose(); RippleImageEditor = null; } if (RoundBottom != null) { RoundBottom.Dispose(); RoundBottom = null; } if (ScrollBottomConstraint != null) { ScrollBottomConstraint.Dispose(); ScrollBottomConstraint = null; } if (ScrollBottomOuterConstraint != null) { ScrollBottomOuterConstraint.Dispose(); ScrollBottomOuterConstraint = null; } if (Sex != null) { Sex.Dispose(); Sex = null; } if (SexLabel != null) { SexLabel.Dispose(); SexLabel = null; } if (Snackbar != null) { Snackbar.Dispose(); Snackbar = null; } if (SnackBottomConstraint != null) { SnackBottomConstraint.Dispose(); SnackBottomConstraint = null; } if (SnackTopConstraint != null) { SnackTopConstraint.Dispose(); SnackTopConstraint = null; } if (TopSeparator != null) { TopSeparator.Dispose(); TopSeparator = null; } if (UseLocationLabel != null) { UseLocationLabel.Dispose(); UseLocationLabel = null; } if (UseLocationSwitch != null) { UseLocationSwitch.Dispose(); UseLocationSwitch = null; } if (Username != null) { Username.Dispose(); Username = null; } if (UsernameLabel != null) { UsernameLabel.Dispose(); UsernameLabel = null; } }
void ReleaseDesignerOutlets() { if (AccountData != null) { AccountData.Dispose(); AccountData = null; } if (AccountDataSection != null) { AccountDataSection.Dispose(); AccountDataSection = null; } if (BottomConstraint != null) { BottomConstraint.Dispose(); BottomConstraint = null; } if (Cancel != null) { Cancel.Dispose(); Cancel = null; } if (ChangePassword != null) { ChangePassword.Dispose(); ChangePassword = null; } if (ChangePasswordSection != null) { ChangePasswordSection.Dispose(); ChangePasswordSection = null; } if (CheckUsername != null) { CheckUsername.Dispose(); CheckUsername = null; } if (ConfirmPassword != null) { ConfirmPassword.Dispose(); ConfirmPassword = null; } if (ConfirmPasswordLabel != null) { ConfirmPasswordLabel.Dispose(); ConfirmPasswordLabel = null; } if (DeactivateAccount != null) { DeactivateAccount.Dispose(); DeactivateAccount = null; } if (DeleteAccount != null) { DeleteAccount.Dispose(); DeleteAccount = null; } if (DescriptionLabel != null) { DescriptionLabel.Dispose(); DescriptionLabel = null; } if (DescriptionText != null) { DescriptionText.Dispose(); DescriptionText = null; } if (DistanceShareAll != null) { DistanceShareAll.Dispose(); DistanceShareAll = null; } if (DistanceShareAllLabel != null) { DistanceShareAllLabel.Dispose(); DistanceShareAllLabel = null; } if (DistanceShareFriend != null) { DistanceShareFriend.Dispose(); DistanceShareFriend = null; } if (DistanceShareFriendLabel != null) { DistanceShareFriendLabel.Dispose(); DistanceShareFriendLabel = null; } if (DistanceShareLabel != null) { DistanceShareLabel.Dispose(); DistanceShareLabel = null; } if (DistanceShareLike != null) { DistanceShareLike.Dispose(); DistanceShareLike = null; } if (DistanceShareLikeLabel != null) { DistanceShareLikeLabel.Dispose(); DistanceShareLikeLabel = null; } if (DistanceShareMatch != null) { DistanceShareMatch.Dispose(); DistanceShareMatch = null; } if (DistanceShareMatchLabel != null) { DistanceShareMatchLabel.Dispose(); DistanceShareMatchLabel = null; } if (DistanceShareNone != null) { DistanceShareNone.Dispose(); DistanceShareNone = null; } if (DistanceShareNoneLabel != null) { DistanceShareNoneLabel.Dispose(); DistanceShareNoneLabel = null; } if (EditImagesUploaded != null) { EditImagesUploaded.Dispose(); EditImagesUploaded = null; } if (Email != null) { Email.Dispose(); Email = null; } if (EmailLabel != null) { EmailLabel.Dispose(); EmailLabel = null; } if (ImageEditor != null) { ImageEditor.Dispose(); ImageEditor = null; } if (ImageEditorCancel != null) { ImageEditorCancel.Dispose(); ImageEditorCancel = null; } if (ImageEditorControls != null) { ImageEditorControls.Dispose(); ImageEditorControls = null; } if (ImageEditorFrame != null) { ImageEditorFrame.Dispose(); ImageEditorFrame = null; } if (ImageEditorFrameBorder != null) { ImageEditorFrameBorder.Dispose(); ImageEditorFrameBorder = null; } if (ImageEditorLabel != null) { ImageEditorLabel.Dispose(); ImageEditorLabel = null; } if (ImageEditorOK != null) { ImageEditorOK.Dispose(); ImageEditorOK = null; } if (ImageEditorStatus != null) { ImageEditorStatus.Dispose(); ImageEditorStatus = null; } if (Images != null) { Images.Dispose(); Images = null; } if (ImagesProgress != null) { ImagesProgress.Dispose(); ImagesProgress = null; } if (ImagesProgressText != null) { ImagesProgressText.Dispose(); ImagesProgressText = null; } if (LoaderCircle != null) { LoaderCircle.Dispose(); LoaderCircle = null; } if (LocationSettings != null) { LocationSettings.Dispose(); LocationSettings = null; } if (LocationSettingsSection != null) { LocationSettingsSection.Dispose(); LocationSettingsSection = null; } if (LocationShareAll != null) { LocationShareAll.Dispose(); LocationShareAll = null; } if (LocationShareAllLabel != null) { LocationShareAllLabel.Dispose(); LocationShareAllLabel = null; } if (LocationShareFriend != null) { LocationShareFriend.Dispose(); LocationShareFriend = null; } if (LocationShareFriendLabel != null) { LocationShareFriendLabel.Dispose(); LocationShareFriendLabel = null; } if (LocationShareLabel != null) { LocationShareLabel.Dispose(); LocationShareLabel = null; } if (LocationShareLike != null) { LocationShareLike.Dispose(); LocationShareLike = null; } if (LocationShareLikeLabel != null) { LocationShareLikeLabel.Dispose(); LocationShareLikeLabel = null; } if (LocationShareMatch != null) { LocationShareMatch.Dispose(); LocationShareMatch = null; } if (LocationShareMatchLabel != null) { LocationShareMatchLabel.Dispose(); LocationShareMatchLabel = null; } if (LocationShareNone != null) { LocationShareNone.Dispose(); LocationShareNone = null; } if (LocationShareNoneLabel != null) { LocationShareNoneLabel.Dispose(); LocationShareNoneLabel = null; } if (Men != null) { Men.Dispose(); Men = null; } if (MenLabel != null) { MenLabel.Dispose(); MenLabel = null; } if (MoreOptions != null) { MoreOptions.Dispose(); MoreOptions = null; } if (MoreOptionsSection != null) { MoreOptionsSection.Dispose(); MoreOptionsSection = null; } if (Name != null) { Name.Dispose(); Name = null; } if (NameLabel != null) { NameLabel.Dispose(); NameLabel = null; } if (NewPassword != null) { NewPassword.Dispose(); NewPassword = null; } if (NewPasswordLabel != null) { NewPasswordLabel.Dispose(); NewPasswordLabel = null; } if (OldPassword != null) { OldPassword.Dispose(); OldPassword = null; } if (OldPasswordLabel != null) { OldPasswordLabel.Dispose(); OldPasswordLabel = null; } if (ProfileEdit_Scroll != null) { ProfileEdit_Scroll.Dispose(); ProfileEdit_Scroll = null; } if (RippleImageEditor != null) { RippleImageEditor.Dispose(); RippleImageEditor = null; } if (RoundBottom != null) { RoundBottom.Dispose(); RoundBottom = null; } if (Save != null) { Save.Dispose(); Save = null; } if (ScrollBottomConstraint != null) { ScrollBottomConstraint.Dispose(); ScrollBottomConstraint = null; } if (ScrollBottomOuterConstraint != null) { ScrollBottomOuterConstraint.Dispose(); ScrollBottomOuterConstraint = null; } if (SexLabel != null) { SexLabel.Dispose(); SexLabel = null; } if (Snackbar != null) { Snackbar.Dispose(); Snackbar = null; } if (SnackBottomConstraint != null) { SnackBottomConstraint.Dispose(); SnackBottomConstraint = null; } if (SnackTopConstraint != null) { SnackTopConstraint.Dispose(); SnackTopConstraint = null; } if (TopSeparator != null) { TopSeparator.Dispose(); TopSeparator = null; } if (UseLocationLabel != null) { UseLocationLabel.Dispose(); UseLocationLabel = null; } if (UseLocationSwitch != null) { UseLocationSwitch.Dispose(); UseLocationSwitch = null; } if (Username != null) { Username.Dispose(); Username = null; } if (UsernameLabel != null) { UsernameLabel.Dispose(); UsernameLabel = null; } if (ViewportConstraint != null) { ViewportConstraint.Dispose(); ViewportConstraint = null; } if (Women != null) { Women.Dispose(); Women = null; } if (WomenLabel != null) { WomenLabel.Dispose(); WomenLabel = null; } }
public override void ViewDidLoad() { try { base.ViewDidLoad(); c.AddViews(Snackbar, Snackbar.SnackText, Snackbar.SnackButton); SexLabel.Text = LangEnglish.Sex; EmailLabel.Text = LangEnglish.Email; EmailExplanationLabel.Text = LangEnglish.EmailExplanation; PasswordLabel.Text = LangEnglish.Password; ConfirmPasswordLabel.Text = LangEnglish.ConfirmPassword; UsernameLabel.Text = LangEnglish.Username; CheckUsername.SetTitle(LangEnglish.CheckAvailability, UIControlState.Normal); NameLabel.Text = LangEnglish.Name; Images.SetTitle(LangEnglish.Images, UIControlState.Normal); ImagesProgressText.Text = ""; DescriptionLabel.Text = LangEnglish.Description; UseLocationLabel.Text = LangEnglish.UseLocation; LocationExplanation.Text = LangEnglish.LocationExplanation; LocationShareLabel.Text = LangEnglish.LocationShare; LocationShareAllLabel.Text = LangEnglish.LocationShareAll; LocationShareLikeLabel.Text = LangEnglish.LocationShareLike; LocationShareMatchLabel.Text = LangEnglish.LocationShareMatch; LocationShareFriendLabel.Text = LangEnglish.LocationShareFriend; LocationShareNoneLabel.Text = LangEnglish.LocationShareNone; DistanceShareLabel.Text = LangEnglish.DistanceShare; DistanceShareAllLabel.Text = LangEnglish.DistanceShareAll; DistanceShareLikeLabel.Text = LangEnglish.DistanceShareLike; DistanceShareMatchLabel.Text = LangEnglish.DistanceShareMatch; DistanceShareFriendLabel.Text = LangEnglish.DistanceShareFriend; DistanceShareNoneLabel.Text = LangEnglish.DistanceShareNone; Register.SetTitle(LangEnglish.Register, UIControlState.Normal); Reset.SetTitle(LangEnglish.Reset, UIControlState.Normal); RegisterCancel.SetTitle(LangEnglish.Cancel, UIControlState.Normal); ImageEditorLabel.Text = LangEnglish.ImageEditorLabel; DescriptionText.Delegate = this; CheckUsername.Layer.MasksToBounds = true; //required for presevering corner radius for highlighted state Images.Layer.MasksToBounds = true; Register.Layer.MasksToBounds = true; Reset.Layer.MasksToBounds = true; RegisterCancel.Layer.MasksToBounds = true; Sex.Model = new DropDownList(LangEnglish.SexEntries, "Sex", 120, this); c.DrawBorder(DescriptionText); c.DrawBorder(EulaText); EulaLabel.Text = LangEnglish.EulaLabel; EulaText.Text = LangEnglish.EulaText; LoaderCircle.Hidden = true; ImageEditorFrameBorder.Layer.BorderColor = UIColor.FromName("PrimaryDark").CGColor; ImageEditorFrameBorder.Layer.BorderWidth = 1; rc = new RegisterCommonMethods(this, c, ImagesUploaded, Email, Username, Name, DescriptionText, CheckUsername, Images, ImagesProgressText, LoaderCircle, ImagesProgress, UseLocationSwitch, LocationShareAll, LocationShareLike, LocationShareMatch, LocationShareFriend, LocationShareNone, DistanceShareAll, DistanceShareLike, DistanceShareMatch, DistanceShareFriend, DistanceShareNone, ImageEditorControls, TopSeparator, RippleImageEditor, ImageEditorStatus, ImageEditorCancel, ImageEditorOK, ImageEditor, ImageEditorFrame, ImageEditorFrameBorder); RegisterScroll.SetContext(this); ImagesUploaded.SetContext(this); ImagesUploaded.numColumns = 5; //it does not get passed in the layout file ImagesUploaded.tileSpacing = 2; if (!File.Exists(regSessionFile)) { regsessionid = ""; } else { regsessionid = File.ReadAllText(regSessionFile); } Register.TouchUpInside += Register_Click; Reset.TouchUpInside += Reset_Click; RegisterCancel.TouchUpInside += RegisterCancel_Click; ImageEditorCancel.TouchUpInside += rc.CancelImageEditing; ImageEditorOK.TouchUpInside += rc.OKImageEditing; RoundBottom_Base = RoundBottom; Snackbar_Base = Snackbar; BottomConstraint_Base = BottomConstraint; SnackTopConstraint_Base = SnackTopConstraint; SnackBottomConstraint_Base = SnackBottomConstraint; ScrollBottomConstraint_Base = ScrollBottomConstraint; ScrollBottomOuterConstraint_Base = ScrollBottomOuterConstraint; } catch (Exception ex) { c.ReportErrorSilent(ex.Message + Environment.NewLine + ex.StackTrace); } }
public void btnSave_Click(object sender, System.EventArgs e) { try { logger.Info(HttpContext.Current.Request.Cookies["User_ID"].Value + " " + System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.ToString() + " " + System.Reflection.MethodBase.GetCurrentMethod().Name); if (btnCP_Save.Text == "แก้ไข") { GetDetailsDataToForm(txtCP_User_ID.Text, "Edit"); ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "SAMWAIT", "myApp.hidePleaseWait();", true); } else { if (txtCP_Password.Text == string.Empty) { txtCP_Password.Text = hdfPasswrod.Value; } Validate("CPValidation"); if (Page.IsValid) { //string User_ID = HttpContext.Current.Request.Cookies["User_ID"].Value; dbo_UserClass user_class = dbo_UserDataClass.Select_Record(hdfUser_ID.Value); Regex r = new Regex("^(?=.*[a-zA-Z])(?=.*[0-9])"); string Pass_Old = user_class.Password.ToString(); List <dbo_PasswordHistoryClass> item = dbo_PasswordHistoryDataClass.Search(txtCP_UserName.Text); dbo_PasswordHistoryClass pass = item.OrderByDescending(f => f.Last_Password_Change_Or_Reset).Take(3).FirstOrDefault(f => f.Password == txtCP_Password.Text); string cntUsername = CheckUsername.Check_Username(txtCP_UserName.Text, txtCP_User_ID.Text); string cntUserID = CheckUsername.Check_UserID(txtCP_User_ID.Text); bool flag = false; if (Pass_Old.ToString() != txtCP_Password.Text) { if (pass != null) { flag = true; //ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "SAMWAIT", "myApp.hidePleaseWait();", true); //Show("รหัสผ่านต้องไม่ซ้ำกันกับ 3 ครั้งที่ผ่านมา"); } } //else //{ // if (Pass_Old.ToString() != txtCP_Password.Text) // { // if (pass != null) // { // flag = true; // //ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "SAMWAIT", "myApp.hidePleaseWait();", true); // //Show("รหัสผ่านต้องไม่ซ้ำกันกับ 3 ครั้งที่ผ่านมา"); // } // } //} if (txtCP_Password.Text.Length < 8) { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "SAMWAIT", "myApp.hidePleaseWait();", true); Show("รหัสผ่านควรมีอย่างน้อย 8 ตัวอักษร"); } else if (!r.IsMatch(txtCP_Password.Text)) { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "SAMWAIT", "myApp.hidePleaseWait();", true); Show("รหัสผ่านควรประกอบด้วยตัวเลขและตัวอักษร"); } //else if (pass != null) //{ // ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "SAMWAIT", "myApp.hidePleaseWait();", true); // Show("รหัสผ่านต้องไม่ซ้ำกันกับ 3 ครั้งที่ผ่านมา"); //} else if (flag == true) { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "SAMWAIT", "myApp.hidePleaseWait();", true); Show("รหัสผ่านต้องไม่ซ้ำกันกับ 3 ครั้งที่ผ่านมา"); flag = false; } else if (cntUserID != "0" && btnSaveMode.Value == "บันทึก") { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "SAMWAIT", "myApp.hidePleaseWait();", true); // Show("รหัสพนักงานไม่สามารถซ้ำได้"); Show("เนื่องจากรหัสพนักงาน " + txtCP_User_ID.Text + " ถูกสร้างขึ้นแล้ว ระบบจะทำการสร้างรหัสพนักงานให้ใหม่"); txtCP_User_ID.Text = GenerateID.UserID_CP(); } else if (cntUsername != "0") { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "SAMWAIT", "myApp.hidePleaseWait();", true); Show("ชื่อผู้ใช้งานไม่สามารถซ้ำได้"); } else { if (btnSaveMode.Value == "บันทึก") { InsertRecord(); if (hdfPasswrod.Value != txtCP_Password.Text) { dbo_PasswordHistoryClass password = new dbo_PasswordHistoryClass(); password.Last_Password_Change_Or_Reset = DateTime.Now; password.Password = txtCP_Password.Text; password.User_ID = txtCP_UserName.Text; dbo_PasswordHistoryDataClass.Add(password); } } else { UpdateRecord(); if (hdfPasswrod.Value != txtCP_Password.Text) { dbo_PasswordHistoryClass password = new dbo_PasswordHistoryClass(); password.Last_Password_Change_Or_Reset = DateTime.Now; password.Password = txtCP_Password.Text; password.User_ID = txtCP_UserName.Text; dbo_PasswordHistoryDataClass.Add(password); } } SearchSubmit(); System.Threading.Thread.Sleep(500); ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "SAMWAIT", "myApp.hidePleaseWait();", true); } } else { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "SAMWAIT", "myApp.hidePleaseWait();", true); Show("กรุณากรอกข้อมูลที่จำเป็นให้ครบถ้วน"); } } } catch (Exception ex) { logger.Debug(ex.Message); } }