예제 #1
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (txtOldPassword.Text == MainForm._employee.Password && txtNewPassword.Text == txtNewPasswordAgain.Text)
     {
         MainForm._employee.Password = txtNewPassword.Text;
         if (_employeeBLL.Update(MainForm._employee))
         {
             mail mail = new mail();
             if (mail.SentMail(
                     MainForm._employee.EMail, "Şifre Güncelleme", string.Format(
                         "Sayın : {0}\nSisteme yeni giriş bilgileriniz aşşağıda verilmiştir. \n\nŞifreniz: {1}\n\n\nİyi Çalışmalar...\n\n\nBlack Group"
                         , MainForm._employee.FullName, txtNewPassword.Text
                         )))
             {
                 MessageBox.Show("Şifreniz güncellenmiştir. \nBilgileriniz mail adresinize gönderildi");
             }
         }
         else
         {
             MessageBox.Show("Güncelleme işlemi başarısız oldu");
         }
     }
     else
     {
         MessageBox.Show("Eski şifrenizi doğru birşekilde giriniz veya Girilen şifreler eşleşmiyor");
     }
 }
예제 #2
0
        private void btnCreatWork_Click(object sender, EventArgs e)
        {
            _work.WorkDetail = txtWorkDetail.Text;
            _work.ProjectID  = (cmbProject.SelectedValue != null)?(int)cmbProject.SelectedValue:0;
            if (cmbEmployee.SelectedValue != null)
            {
                _work.EmployeeID = (int)cmbEmployee.SelectedValue;
            }
            _work.ManagerID = MainForm._employee.ID;
            DateTime date = new DateTime(DateTime.Now.Date.Year, DateTime.Now.Date.Month, DateTime.Now.Date.Day);

            _work.CreationDate = date;
            _work.WorkStatusID = 1;
            if (_workBLL.Add(_work))
            {
                mail mail = new mail();
                if (_work.EmployeeID != null)
                {
                    _work.Employee = _employeeBLL.Get((int)cmbEmployee.SelectedValue);
                    if (mail.SentMail(_work.Employee.EMail, "Yeni Atanan iş", MainForm._employee.FullName + " tarafından size iş tanımlanmıştır. \n\n\nİyi çalışmalar dileriz. \n\nBlack Group :)"))
                    {
                        MessageBox.Show("İş oluşturuldu sistem çalışana mail gönderdi");
                        if (_newRequestToWork != null)
                        {
                            _newRequestToWork.State = false;
                            RequestBLL requestBLL = new RequestBLL();
                            if (requestBLL.Update(_newRequestToWork))
                            {
                                this.Close();
                            }
                        }
                    }
                }
                else
                {
                    MessageBox.Show("İş oluşturuldu işe çalışan atanmadı");
                }
            }
            else
            {
                MessageBox.Show("Hata meydana geldi");
            }
        }
예제 #3
0
        private void btnEmployeeAdd_Click(object sender, EventArgs e)
        {
            if (txtFirstName.Text != string.Empty && txtLastName.Text != string.Empty && txtMail.Text != string.Empty && txtPassword.Text != string.Empty)
            {
                if (_updateEmployee == null)
                {
                    int pass = rnd.Next(10000000, 99999999);

                    employee.FirstName  = txtFirstName.Text;
                    employee.LastName   = txtLastName.Text;
                    employee.PositionID = (int)cmbPosition.SelectedValue;
                    employee.EMail      = txtMail.Text;
                    employee.Password   = pass.ToString();
                    if (employeeBLL.Add(employee))
                    {
                        mail mail = new mail();
                        if (mail.SentMail(txtMail.Text, "Aramıza hoşgeldiniz", string.Format(
                                              "Değerli çalışanımız : {0}\n\nBizimle olmanızdan dolayı mutluyuz\n\nSistemi kullanmak için bilgileriniz : \n\nMail Adres:{1}\nParola : {2}\n\n\n\nİyi Çalışmalar dileriz\n\nBlack Group"
                                              , employee.FullName, employee.EMail, employee.Password
                                              )))
                        {
                            MessageBox.Show("Çalışan kaydı oluşturuldu bilgiler çalışan mail adresine gönderildi");
                        }
                    }
                    else
                    {
                        MessageBox.Show("Kayıt Ekleme Başarısız");
                    }
                }
                else
                {
                    _updateEmployee.FirstName  = txtFirstName.Text;
                    _updateEmployee.LastName   = txtLastName.Text;
                    _updateEmployee.PositionID = (int)cmbPosition.SelectedValue;
                    _updateEmployee.EMail      = txtMail.Text;
                    _updateEmployee.Password   = txtPassword.Text;

                    if (employeeBLL.Update(_updateEmployee))
                    {
                        MessageBox.Show("Güncelleme başarılı");
                    }
                    else
                    {
                        MessageBox.Show("Güncelleme işlemi başarısız");
                    }
                }
                bool control = true;
                foreach (var item in MdiParent.MdiChildren)
                {
                    if (item is EmployeeListForm)
                    {
                        ((EmployeeListForm)item).EmployeeList();
                        item.BringToFront();
                        control = false;
                    }
                }
                if (control)
                {
                    EmployeeListForm employeeList = new EmployeeListForm();
                    employeeList.MdiParent = MdiParent;
                    employeeList.Show();
                }
            }
            else
            {
                MessageBox.Show("Boş Alan Bırakmayınız!");
            }
        }