public DoctorStartWork(DoctorMain F, long Client_Id, long Proc_Id) { InitializeComponent(); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; //this.WindowState = FormWindowState.Maximized; back = F; this.Proc_Id = Proc_Id; this.Client_Id = Client_Id; ClientName.Text = client.Get_Item("Id", Client_Id.ToString(), ConditionType.Equal).Surname + " " + client.Get_Item("Id", Client_Id.ToString(), ConditionType.Equal).Name + " " + client.Get_Item("Id", Client_Id.ToString(), ConditionType.Equal).Patronymic; }
private void LogIn_Click(object sender, EventArgs e) { User user = new User(); if (LogInField.Text == "") { MessageBox.Show("Доступ запрещён!"); PasswordField.Clear(); } else if (user.Get_Item("Login", LogInField.Text, ConditionType.Equal) == null) { MessageBox.Show("Несуществующий логин"); LogInField.Clear(); PasswordField.Clear(); } else if ((user.Get_Item("Login", LogInField.Text, ConditionType.Equal).Password == PasswordField.Text) && (user.Get_Item("Login", LogInField.Text, ConditionType.Equal) != null)) { switch (user.Get_Item("Login", LogInField.Text, ConditionType.Equal).Permition_Level) { case 0: { ReseptionMain F = new ReseptionMain(this); F.Show(); this.Visible = false; break; } case 1: { DoctorMain F = new DoctorMain(this, user.Get_Item("Login", LogInField.Text, ConditionType.Equal).Id); F.Show(); this.Visible = false; break; } case 2: { MedpersonalMain F = new MedpersonalMain(this); F.Show(); this.Visible = false; break; } case 3: { AdminMainForm F = new AdminMainForm(this); F.Show(); this.Visible = false; break; } case 6: { MessageBox.Show("Совпадений не найдено"); break; } } LogInField.Clear(); PasswordField.Clear(); } else if ((user.Get_Item("Login", LogInField.Text, ConditionType.Equal).Password != PasswordField.Text)) { MessageBox.Show("Неправильный пароль"); PasswordField.Clear(); } }