Ejemplo n.º 1
0
 private void AddPersonel_Load(object sender, EventArgs e)
 {
     cmbDepartment.DataSource = GetDbItems.GetDepartments();
     cmbDep.DataSource        = GetDbItems.GetDepartments();
     cmbUpPers.DataSource     = GetDbItems.GetPersonel();
     cmbDelPers.DataSource    = GetDbItems.GetPersonel();
 }
Ejemplo n.º 2
0
        private void btnDel_Click(object sender, EventArgs e)
        {
            try
            {
                var person = (from a in _ip.PersonalInformations where a.Name + " " + a.Surname == cmbDelPers.SelectedItem select a).FirstOrDefault();
                person.IsDeleted   = true;
                person.DeletedTime = DateTime.Now;
                _ip.SubmitChanges();
                lblDurum.Text         = "Personel silindi";
                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 = "Persoonel silme başarısız";
            }
        }
Ejemplo n.º 3
0
        private void cmbDep_SelectedIndexChanged(object sender, EventArgs e)
        {
            var id   = (from a in ip.Departments where a.AuthName == cmbDep.SelectedItem select a.AuthID).FirstOrDefault();
            var pers = from b in ip.PersonalInformations where b.Departman == id select b;

            if (pers.Count() != 0)
            {
                cmbPers.DataSource = null;
                cmbPers.Items.Clear();
                foreach (var item in pers)
                {
                    cmbPers.Items.Add(item.Name + " " + item.Surname);
                }
                cmbPers.SelectedIndex = 0;
            }
            else
            {
                cmbPers.DataSource = GetDbItems.GetPersonel();
            }
        }
Ejemplo n.º 4
0
        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";
            }
        }
Ejemplo n.º 5
0
 private void Status_Load(object sender, EventArgs e)
 {
     cmbDep.DataSource      = GetDbItems.GetDepartments();
     cmbServices.DataSource = GetDbItems.GetMissions();
     cmbPers.DataSource     = GetDbItems.GetPersonel();
 }