private void frm_server_Load(object sender, EventArgs e) { IniFile ini = new IniFile(Tool.confg); txt_Server.Text = ini.IniReadValue("SERVER", "SERVER"); txt_database.Text = ini.IniReadValue("SERVER", "Database"); txt_userID.Text = ini.IniReadValue("SERVER", "UID"); txt_Password.Text = EncodeString.Decrypt(ini.IniReadValue("SERVER", "Pwd")); }
private void cb_show_pwd_CheckedChanged(object sender, EventArgs e) { try { if (cb_show_pwd.Checked) { // e_password = txt_password.Text; txt_password.UseSystemPasswordChar = false; //txt_password.Text = EncodeString.Decrypt(txt_password.Text); } else { txt_password.UseSystemPasswordChar = true; // txt_password.Text = EncodeString.Encrypt(txt_password.Text); } } catch { txt_password.Text = EncodeString.Decrypt(e_password); } }
public void getDetails(string cn) { rbStudent.Visible = false; rbUser.Visible = false; DataClasses1DataContext db = new DataClasses1DataContext(Tool.ConnectionString); var i = db.AccountSelectByID(this.Tag.ToString()).FirstOrDefault(); if (!i.Level_cn.Equals(3)) { wizard1.SelectedTab = tabPage3; txt_fname.Text = i.Firstname; txt_MName.Text = i.Middlename; txt_Lname.Text = i.Lastname; txt_username.Text = i.Email; cbo_level.Tag = i.Level_cn; txt_username.Text = i.Email; try { DateTime Bd = i.BirrthDate.Value; dtBirthDate.Text = Bd.ToShortDateString(); } catch (Exception ex) { Console.WriteLine(ex.Message); } txtSy.Text = i.SchoolYear; txtStrand.Text = i.Strand; txtGuardiansName.Text = i.GuardianName; txt_password.Text = EncodeString.Decrypt(i.Password); try { pbUser.Image = Tool.bytetoimage(i.AVATAR.ToArray()); } catch (Exception) { pbUser.Image = Properties.Resources.AnonymousPic; } try { FingerPrintScanner.FingerprintTemplate = i.biometrics.ToArray(); } catch (Exception) { } } else { wizard1.SelectedTab = tabPage4; FirstNameStudent.Text = i.Firstname; MiddleNameStudent.Text = i.Middlename; LastNameStudent.Text = i.Lastname; LRNStudent.Text = i.LRN; txtQrCode.Text = i.RFID; cboGrade.Text = i.GradeName; cboSection.Text = i.Section_; cboCourse.Text = i.CourseName; txtSectionOther.Text = i.SectionOther; txtGradeOther.Text = i.GradeName; PhoneNumberStudent.Text = i.PhoneNo; txtGuardiansName.Text = i.GuardianName; string schedule = i.Schedule; string[] scheduleSplited = schedule.Split('/'); dt_TimeIN.Text = scheduleSplited[0]; dt_TimeOUT.Text = scheduleSplited[1]; txtAdviser.Text = i.Adviser; try { pbStudent.Image = Tool.bytetoimage(i.AVATAR.ToArray()); } catch (Exception) { pbStudent.Image = Properties.Resources.AnonymousPic; } try { FingerPrintScanner.FingerprintTemplate = i.biometrics.ToArray(); } catch (Exception) { } } }
private void Main_Load(object sender, EventArgs e) { try { IniFile ini = new IniFile(Tool.confg); Tool.ConnectionString = "Data Source=" + ini.IniReadValue("SERVER", "Server") + ";Initial Catalog=" + ini.IniReadValue("SERVER", "Database") + ";Persist Security Info=True;User ID=" + ini.IniReadValue("SERVER", "UID") + ";Password="******"SERVER", "Pwd")) + ";"; if (!File.Exists(Tool.confg)) { ini.IniWriteValue("SYSTEM", "Name", "Change System name in config.ini"); ini.IniWriteValue("LOCATION", "Address", ""); } Tool.Systemname = ini.IniReadValue("SYSTEM", "Name"); lbl_system_name.Text = Tool.Systemname; this.Hide(); new frm_login(this).ShowDialog(); } catch (Exception) { new frm_server().ShowDialog(); throw; } }