public DialogResult vysledek() { if (Directory.Exists(Environment.CurrentDirectory + @"\Data\Users\" + User_log.Text)) { try { using (StreamReader pass = new StreamReader(Environment.CurrentDirectory + @"\Data\Users\" + User_log.Text + "\\password.dta", Encoding.Default)) { heslo = pass.ReadLine(); pass.Close(); } if (User_pass.Text == heslo) { dr = DialogResult.OK; with_login.DialogResult = System.Windows.Forms.DialogResult.OK; return(dr); } else { pass = false; dr = DialogResult.None; with_login.DialogResult = System.Windows.Forms.DialogResult.None; return(dr); } } catch { oznam ozn = new oznam(); ozn.nadpis.Text = label7.Text; ozn.Size = new Size(300, ozn.Size.Width); ozn.text.Text = label8.Text; ozn.Size = new System.Drawing.Size(475, 201); ozn.icoprog.BackgroundImage = Mate_version2.Properties.Resources.krat; ozn.ShowDialog(); dr = DialogResult.None; return(dr); } } else { user = false; dr = DialogResult.None; return(dr); } }
private void delete_btn_Click(object sender, EventArgs e) { // zmena(sender, e); if (dr == System.Windows.Forms.DialogResult.OK) { if (i == 0) { oznam ozn = new oznam(); ozn.Title.Text = label3.Text; ozn.icoprog.BackgroundImage = global::Mate_version2.Properties.Resources.ok; ozn.nadpis.Text = label4.Text; ozn.Size = new System.Drawing.Size(ozn.Size.Width, 300); ozn.text.Text = label5.Text; ozn.ShowDialog(); delete_btn.DialogResult = DialogResult.OK; i = 1; // delete_btn.Location = new Point(52,12); } } else { if (pass == false) { oznam ozn = new oznam(); ozn.Title.Text = label6.Text; ozn.icoprog.BackgroundImage = global::Mate_version2.Properties.Resources.krat; ozn.nadpis.Text = label6.Text; ozn.Size = new System.Drawing.Size(ozn.Size.Width, 250); ozn.text.Text = label6.Text + "."; ozn.ShowDialog(); } else if (user == false) { oznam ozn = new oznam(); ozn.Title.Text = label7.Text; ozn.icoprog.BackgroundImage = global::Mate_version2.Properties.Resources.krat; ozn.nadpis.Text = label7.Text; ozn.Size = new System.Drawing.Size(ozn.Size.Width, 250); ozn.text.Text = label8.Text; ozn.ShowDialog(); } delete_btn.DialogResult = DialogResult.None; } }
private void with_login_Click(object sender, EventArgs e) { // zmena(sender, e); dr = vysledek(); if (dr == System.Windows.Forms.DialogResult.OK) { if (i == 0) { oznam ozn = new oznam(); ozn.nadpis.Text = this.Title.Text; ozn.text.Text = label3.Text; ozn.Size = new System.Drawing.Size(475, 201); ozn.ShowDialog(); with_login.DialogResult = DialogResult.OK; i = 1; } } else { if (pass == false) { oznam ozn = new oznam(); ozn.nadpis.Text = label4.Text; ozn.text.Text = label4.Text + "."; ozn.Size = new System.Drawing.Size(475, 201); ozn.icoprog.BackgroundImage = Mate_version2.Properties.Resources.krat; ozn.ShowDialog(); } else if (user == false) { oznam ozn = new oznam(); ozn.nadpis.Text = label5.Text; ozn.text.Text = label6.Text; ozn.Size = new System.Drawing.Size(475, 201); ozn.icoprog.BackgroundImage = Mate_version2.Properties.Resources.krat; ozn.ShowDialog(); } with_login.DialogResult = DialogResult.None; } }
private System.Windows.Forms.DialogResult vysledek() { DialogResult dr = new DialogResult(); try { using (StreamReader oldpass = new StreamReader(Environment.CurrentDirectory + @"\Data\Users\" + label4.Text + "\\password.dta", Encoding.Default)) { heslo = oldpass.ReadLine(); oldpass.Close(); } if (old_pass.Text == heslo) { dr = DialogResult.OK; return(dr); } else { oznam ozn = new oznam(); ozn.nadpis.Text = label9.Text; ozn.text.Text = label9.Text + "."; ozn.icoprog.BackgroundImage = global::Mate_version2.Properties.Resources.krat; ozn.Size = new System.Drawing.Size(475, 220); ozn.ShowDialog(); dr = DialogResult.None; return(dr); } } catch { oznam ozn = new oznam(); ozn.text.Text = label10.Text; ozn.nadpis.Text = label11.Text; ozn.icoprog.BackgroundImage = global::Mate_version2.Properties.Resources.krat; ozn.Size = new System.Drawing.Size(475, 220); ozn.ShowDialog(); dr = DialogResult.None; return(dr); } }
private void change_Click(object sender, EventArgs e) { if (vysledek() == System.Windows.Forms.DialogResult.OK) { if (i == 0) { oznam ozn = new oznam(); ozn.nadpis.Text = label7.Text; ozn.text.Text = label8.Text; ozn.Size = new System.Drawing.Size(475, 220); ozn.ShowDialog(); change.DialogResult = DialogResult.OK; i = 1; old_pass.Enabled = false; new_Pass1.Enabled = false; new_Pass2.Enabled = false; cancel.Enabled = false; } } else { change.DialogResult = DialogResult.None; } }