private void AddPersonel_Load(object sender, EventArgs e) { cmbDepartment.DataSource = GetDbItems.GetDepartments(); cmbDep.DataSource = GetDbItems.GetDepartments(); cmbUpPers.DataSource = GetDbItems.GetPersonel(); cmbDelPers.DataSource = GetDbItems.GetPersonel(); }
private void btnOK_Click(object sender, EventArgs e) { try { bool result = PersonelProcess.AddPersonal(Guid.NewGuid(), txtAdi.Text, txtSoyadi.Text, txtTelefon.Text, txtTCNo.Text, txtAdress.Text, txtMailAdress.Text, fileName, (from a in _ip.Departments where a.AuthName == cmbDepartment.SelectedItem select a.AuthID).FirstOrDefault(), txtUser.Text, txtPassw.Text, DateTime.Now, false, Convert.ToDateTime("1900-10-01 00:00:00.000") ); if (result) { lblDurum.Text = "Kayıt başarılı"; cmbDepartment.DataSource = GetDbItems.GetDepartments(); cmbDep.DataSource = GetDbItems.GetDepartments(); cmbUpPers.DataSource = GetDbItems.GetPersonel(); cmbDelPers.DataSource = GetDbItems.GetPersonel(); MainForm main = (MainForm)Application.OpenForms["MainForm"]; main.flowLayoutPanel1.Controls.Clear(); int index = 0; var personals = from a in _ip.PersonalInformations where a.IsDeleted == false select a; // index = personals.Count(); // this.Location = new Point(Screen.FromPoint(this.Location).WorkingArea.Right - this.Width); foreach (var item in personals) { Personal pers = new Personal(); pers.Tag = index; pers.lblPersName.Text = item.Name + " " + item.Surname; try { pers.picPers.Image = Image.FromFile(item.P_Image); } catch (Exception) { } try { pers.picPers.Image = HelpMe.ScaleImage(Image.FromFile(item.P_Image), 80, 74); } catch (Exception) { } pers.picStat.Image = Properties.Resources.green; pers.picStat.Image = HelpMe.ScaleImage(Properties.Resources.green, 20, 18); main.flowLayoutPanel1.Controls.Add(pers); //f.Controls.Add(pers); index++; } } } catch (Exception) { lblDurum.Text = "Kayıt başarısız"; } }
private void Status_Load(object sender, EventArgs e) { cmbDep.DataSource = GetDbItems.GetDepartments(); cmbServices.DataSource = GetDbItems.GetMissions(); cmbPers.DataSource = GetDbItems.GetPersonel(); }