public async Task <IActionResult> Create([Bind("Id,OfisId")] Personel personel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(personel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Id"]     = new SelectList(_context.Users, "Id", "Ad", personel.Id);
            ViewData["OfisId"] = new SelectList(_context.Ofis, "Id", "Id", personel.OfisId);
            return(View(personel));
        }
示例#2
0
 public ActionResult Kaydet(Personel personel)
 {
     if (personel.Id == 0) //Ekleme işlemi
     {
         db.Personel.Add(personel);
     }
     else //Güncelle
     {
         db.Entry(personel).State = System.Data.Entity.EntityState.Modified;
     }
     db.SaveChanges();
     return(RedirectToAction("Index", "Personel"));
 }
 public IActionResult Kaydet(Personel personel)
 {
     if (personel.Id == 0)
     {
         db.Add(personel);
     }
     else
     {
         db.Entry(personel).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
     }
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }
示例#4
0
        public ActionResult Duzenle(int id)
        {
            Personel personel = db.Personeller.Find(id);

            if (personel == null)
            {
                return(HttpNotFound());
            }

            ViewBag.DepartmanId = new SelectList(db.Departmanlar.ToList(), "Id", "DepartmanAd");

            return(View(personel));
        }
示例#5
0
 private void FillUser()
 {
     if (user == null)
     {
         user          = new Personel();
         user.password = Password_TextBox.Text;
     }
     user.date_retire = Date_Retire.Value;
     user.first_name  = Name_TextBox.Text;
     user.last_name   = Surname_TextBox.Text;
     user.username    = Username_TextBox.Text;
     user.role        = Role_ComboBox.Text;
 }
        public void Add(Personel personel)
        {
            var PutTask = client.PostAsJsonAsync <Personel>("api/personels", personel);

            PutTask.Wait();

            var result = PutTask.Result;

            if (!result.IsSuccessStatusCode)
            {
                throw new Exception(result.ReasonPhrase);
            }
        }
示例#7
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            Personel personel = await db.Personels.FindAsync(id);

            if (personel.active == (int)EnumHelperData.Satatus.Aktif)
            {
                personel.active = (int)EnumHelperData.Satatus.Pasif;
            }
            //db.Personels.Remove(personel);
            await db.SaveChangesAsync();

            return(RedirectToAction("PersonnelList", "Home"));
        }
示例#8
0
        private void btnPerGuncelle_Click(object sender, EventArgs e)
        {
            try
            {
                int secilenKisiID    = Convert.ToInt32(txtPerNo.Text);
                UcusTakipEntities vt = new UcusTakipEntities();
                Personel          p1 = vt.Personels.FirstOrDefault(p => p.PersonelNo == secilenKisiID);
                p1.Ad           = txtPerAd.Text;
                p1.Soyad        = txtPerSoyad.Text;
                p1.SinifRutbesi = txtSinifRutbesi.Text;
                if (txtSicilNo.Text != "")
                {
                    p1.SicilNo = Convert.ToInt32(txtSicilNo.Text);
                }
                if (txtBroveNo.Text != "")
                {
                    p1.BroveNo = Convert.ToInt32(txtBroveNo.Text);
                }
                p1.DogumTarihi            = dtPerDT.Value;
                p1.Birligi                = txtBirlik.Text;
                p1.UcusBirligi            = txtUcusBirlik.Text;
                p1.IlkUcusTarihi          = dtİlkUcusBas.Value;
                p1.TemelKursBitirmeTarihi = dtTemelKursBitis.Value;
                if (dtTemelKursBitis.Value != null)
                {
                    DateTime baslangicYil = dtTemelKursBitis.Value;
                    p1.ToplamUcusYılı = DateTime.Now.Year - baslangicYil.Year;
                }
                lblToplamUcusYılı.Text = p1.ToplamUcusYılı.ToString();
                if (rbKita.Checked == true)
                {
                    p1.GorevDurumu = "Kıt'a";
                }
                if (rbKita.Checked == true)
                {
                    p1.GorevDurumu = "Kurum/Kh.";
                }

                int sonuc = vt.SaveChanges();
                if (sonuc > 0)
                {
                    MessageBox.Show("İşlem Başarlı");
                    TumKayitleriListele();
                    AlanlariTemizle();
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Lütfen kayıt seçiniz.");
            }
        }
 public bool Personel_Ekle(Personel personel)
 {
     SqlParameter[] p =
     {
         new SqlParameter("@KullaniciAdi", (object)personel.KullaniciAdi),
         new SqlParameter("@Sifre",        (object)personel.Sifre),
         new SqlParameter("@YetkiID",      (object)personel.YetkiID),
         new SqlParameter("@Adı",          (object)personel.PersonelAdi),
         new SqlParameter("@Soyadı",       (object)personel.PersonelSoyadi),
         new SqlParameter("@TC_Kimlik",    (object)personel.PersonelTC),
         new SqlParameter("@Cinsiyet",     (object)personel.PersonelCinsiyet)
     };
     return(this.hlp.ExecuteNonQuery("Insert into Personel values(@Adı,@Soyadı,@TC_Kimlik,@Cinsiyet,@KullaniciAdi,@Sifre,@YetkiID)", p) > 0);
 }
示例#10
0
        public ActionResult Create(Personel personel)
        {
            ModelState.Remove("ModifiedUsername");
            ModelState.Remove("CreatedOn");
            ModelState.Remove("KullaniciAdi");
            ModelState.Remove("Sifre");
            if (ModelState.IsValid)
            {
                personelManager.Insert(personel);
                return(RedirectToAction("Index"));
            }

            return(View(personel));
        }
示例#11
0
 public ActionResult Ekle(Personel p)
 {
     try
     {
         db.Personel.Add(p);
         db.SaveChanges();
         TempData["GenelMesaj"] = "Kullanıcı ekleme işlemi başarılı bir şekilde tamamlanmıştır.";
         return(RedirectToAction("Listesi"));
     }
     catch (Exception)
     {
         return(Redirect("/Admin/Hata"));
     }
 }
        public ActionResult YeniGelir(int id = 0)
        {
            AyarMetot.Siradaki("", "MASRAF", "IslemNo", Session["FirmaID"].ToString());
            ViewBag.MasrafSiradakiNo = AyarMetot.GetNumara;
            if (Session["Grubu"].ToString() != "Teknik Servis Kullanıcısı")
            {
                if (id != 0)
                {
                    CASH_PAY cp = db.CASH_PAY.Where(x => x.ID == id).FirstOrDefault <CASH_PAY>();
                    if (cp.IslemTipi != "KAF" && cp.IslemTipi != "BAF")
                    {
                        return(View(cp));
                    }
                    else
                    {
                        return(RedirectToAction("FinansHareketleri", "Finans"));
                    }
                }
                else
                {
                    return(View(new CASH_PAY()));
                }
            }
            else
            {
                try
                {
                    TECHNICAL tech = db.TECHNICAL.Where(x => x.ID == id).FirstOrDefault <TECHNICAL>();
                    ViewBag.ServisCariID = tech.CariID;
                }
                catch
                {
                }

                try
                {
                    ViewBag.ServisPersonelID = Convert.ToInt32(Session["PersonelID"].ToString());
                    int      idpersonel = Convert.ToInt32(Session["PersonelID"].ToString());
                    Personel pr         = db.Personel.Where(x => x.ID == idpersonel).FirstOrDefault <Personel>();
                    ViewBag.PersonelKasaId  = pr.vKasaID;
                    ViewBag.PersonelBankaId = pr.vBankaID;
                }
                catch
                {
                }


                return(View(new CASH_PAY()));
            }
        }
 public ActionResult PersonelGuncelle(Personel personel)
 {
     if (ModelState.IsValid)
     {
         var p = c.Personels.Find(personel.PersonelId);
         p.PersonelAd     = personel.PersonelAd;
         p.PersonelSoyad  = personel.PersonelSoyad;
         p.PersonelGorsel = personel.PersonelGorsel;
         p.DepartmanId    = personel.DepartmanId;
         c.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(personel));
 }
示例#14
0
        public IActionResult PersonelGuncelle(Personel p)
        {
            var personel = context.Personels.Find(p.PersonelID);

            personel.Ad    = p.Ad;
            personel.Soyad = p.Soyad;
            personel.Sehir = p.Sehir;
            //urun.TBLKATEGORILER.KATEGORIAD = p1.TBLKATEGORILER.KATEGORIAD;
            var birim = context.Birims.Where(m => m.BirimID == p.Birim.BirimID).FirstOrDefault();

            personel.BirimID = birim.BirimID;
            context.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#15
0
        public JsonResult DeletePersonel(int id)
        {
            bool     result = false;
            Personel per    = db.Personel.SingleOrDefault(x => x.id == id);

            if (per != null)
            {
                per = db.Personel.Where(x => x.id == id).FirstOrDefault();
                db.Personel.Remove(per);
                db.SaveChanges();
                result = true;
            }
            return(Json(result, JsonRequestBehavior.AllowGet));
        }
示例#16
0
        private void btnSil_Click(object sender, EventArgs e)
        {
            secilipersonel = lstKayıtlar.SelectedItem as Personel;
            if (secilipersonel == null)
            {
                return;
            }

            Personeller.Remove(secilipersonel);
            FormuTemizle();
            ListeyiDoldur();
            secilipersonel = null;
            MessageBox.Show("Personel Kaydı Silindi.");
        }
示例#17
0
        // GET: Personels/Details/5
        public async Task <ActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Personel personel = await db.Personels.FindAsync(id);

            if (personel == null)
            {
                return(HttpNotFound());
            }
            return(View(personel));
        }
示例#18
0
        public async void With_InMemorySetting_DbContext_Should_Connect_To_InMemory()
        {
            ApplicationDbContext context = GetInMemoryDbContext();
            var p = new Personel
            {
                FirstName   = "Yashar",
                LastName    = "Aliabbasi",
                DateOfBirth = DateTime.Now.AddYears(-30)
            };

            context.Personels.Add(p);
            context.SaveChanges();
            Assert.Equal(1, await context.Personels.CountAsync());
        }
示例#19
0
        // GET: Personel/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Personel personel = personelManager.Find(x => x.Id == id);

            if (personel == null)
            {
                return(HttpNotFound());
            }
            return(View(personel));
        }
        public async Task <JsonResult> Guncel([FromBody] PersonelDTO pr)
        {
            Personel personel = new Personel();

            personel.PersonelId    = pr.personelId;
            personel.PersonelAd    = pr.personelAd;
            personel.PersonelSoyad = pr.personelSoyad;
            personel.SehirId       = pr.sehirId;

            _reppersonel.Save(personel);
            await _reppersonel.Comit();

            return(Json(pr));
        }
示例#21
0
 public ActionResult PersonelEkle(Personel p)
 {
     if (Request.Files.Count > 0)
     {
         string dosyadi = Path.GetFileName(Request.Files[0].FileName);
         string uzanti  = Path.GetExtension(Request.Files[0].FileName);
         string yol     = "~/images/" + dosyadi + uzanti;
         Request.Files[0].SaveAs(Server.MapPath(yol));
         p.PERSONELGORSEL = "/images/" + dosyadi + uzanti;
     }
     c.Personels.Add(p);
     c.SaveChanges();
     return(RedirectToAction("Index"));
 }
示例#22
0
        private void btnPerEkle_Click(object sender, EventArgs e)
        {
            try
            {
                Personel p1 = new Personel();
                p1.Ad                     = txtPerAd.Text;
                p1.Soyad                  = txtPerSoyad.Text;
                p1.SinifRutbesi           = txtSinifRutbesi.Text;
                p1.SicilNo                = Convert.ToInt32(txtSicilNo.Text);
                p1.BroveNo                = Convert.ToInt32(txtBroveNo.Text);
                p1.DogumTarihi            = dtPerDT.Value;
                p1.Birligi                = txtBirlik.Text;
                p1.UcusBirligi            = txtUcusBirlik.Text;
                p1.IlkUcusTarihi          = dtİlkUcusBas.Value;
                p1.TemelKursBitirmeTarihi = dtTemelKursBitis.Value;
                if (dtTemelKursBitis.Value != null)
                {
                    DateTime bitis = dtTemelKursBitis.Value;
                    p1.ToplamUcusYılı = DateTime.Now.Year - bitis.Year;
                }
                lblToplamUcusYılı.Text = p1.ToplamUcusYılı.ToString();
                if (rbKita.Checked == true)
                {
                    p1.GorevDurumu = "Kıt'a";
                }
                if (rbKita.Checked == true)
                {
                    p1.GorevDurumu = "Kurum/Kh.";
                }

                UcusTakipEntities vt = new UcusTakipEntities();
                vt.Personels.Add(p1);

                int sonuc = vt.SaveChanges();
                if (sonuc > 0)
                {
                    MessageBox.Show("Kayıt Başarılı");
                    TumKayitleriListele();
                    AlanlariTemizle();
                }
                else
                {
                    MessageBox.Show("Kayıt Başarısız");
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Lütfen Alanları Doldurunuz.");
            }
        }
示例#23
0
        public static void PersoneliSil(Personel secilenPersonel)
        {
            DialogResult cevap = MessageBox.Show($"Hemşire {secilenPersonel.personAd + " " + secilenPersonel.personSoyad} silmek istediğinizden emin misiniz?", "SİLME İŞLEMİ ONAY", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (cevap == DialogResult.Yes)
            {
                PersonelServis.PersonelListesi.Remove(secilenPersonel);
                MessageBox.Show("Personel silinmiştir.");
            }
            else
            {
                MessageBox.Show("Silme işlemi iptal edildi");
            }
        }
示例#24
0
        // GET: Personel/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Personel personel = db.Personel.Find(id);

            if (personel == null)
            {
                return(HttpNotFound());
            }
            return(View(personel));
        }
示例#25
0
        public void AddNewItem()
        {
            ExceptionCatcher.ExceptionFinder(() => {
                using (SDB sdbContext = new SDB())
                {
                    if (personelEntity == null)
                    {
                        Personel personel         = new Personel();
                        personel.PersonelAd       = personalName.Text;
                        personel.PersonelSoyad    = personelLastname.Text;
                        personel.PersonelRoleID   = chkboxAdmin.IsChecked.Value == true ? int.Parse(chkboxAdmin.Tag.ToString()) : chkboxUser.IsChecked.Value == true ? int.Parse(chkboxUser.Tag.ToString()) : int.Parse(chkboxUser2.Tag.ToString());
                        personel.PersonelUsername = personelUsername.Text;
                        personel.PersonelPassword = HashingHelper.HashingPassword(personelPassword.Text);

                        personel.PersonelPic = ImageHelper.ConvertImageToByte(Per_pic_url.Text);
                        DAL.DAL dal          = new DAL.DAL();
                        dal.NewRecordPer(personel);

                        gridPersonelForm.Visibility      = Visibility.Collapsed;
                        gridcontrol_personel.ItemsSource = null;
                        GetPersonelList();
                    }
                    else
                    {
                        Personel personel         = new Personel();
                        personel.PersonelID       = personelEntity.PersonelID;
                        personel.PersonelAd       = personalName.Text;
                        personel.PersonelSoyad    = personelLastname.Text;
                        personel.PersonelRoleID   = chkboxAdmin.IsChecked.Value == true ? int.Parse(chkboxAdmin.Tag.ToString()) : chkboxUser.IsChecked.Value == true ? int.Parse(chkboxUser.Tag.ToString()) : int.Parse(chkboxUser2.Tag.ToString());
                        personel.PersonelUsername = personelUsername.Text;
                        personel.PersonelPassword = HashingHelper.HashingPassword(personelPassword.Text);
                        if (personelEntity.PersonelPic != null)
                        {
                            personel.PersonelPic = personelEntity.PersonelPic;
                        }


                        DAL.DAL dal = new DAL.DAL();
                        dal.UpdateRecordPer(personel);
                        MainWindow window = (MainWindow)Window.GetWindow(this);
                        window.RibbonController();
                        gridPersonelForm.Visibility      = Visibility.Collapsed;
                        gridcontrol_personel.ItemsSource = null;
                        GetPersonelList();
                        ClearForm();
                    }
                }
            });
        }
示例#26
0
        public IActionResult PersonelGuncelle(Personel Vperson)
        {
            var Gpersonel = c.personellers.Find(Vperson.personelId);
            var per       = c.departmanlars.Where(x => x.Id == Vperson.depart.Id).FirstOrDefault();

            Gpersonel.depart           = per;
            Gpersonel.personelAd       = Vperson.personelAd;
            Gpersonel.personelSoyad    = Vperson.personelSoyad;
            Gpersonel.iseBaslamaTarihi = Vperson.iseBaslamaTarihi;
            Gpersonel.telNo            = Vperson.telNo;
            Gpersonel.mailAdres        = Vperson.mailAdres;

            c.SaveChanges();
            return(RedirectToAction("PersonelListele"));
        }
示例#27
0
        public ActionResult PersonelEkle(Personel p)
        {
            if (Request.Files.Count > 0)//eğer yaptığım işlemler içerisinde bir dosya tutuyorsam, isteklerimden biri bir dosya ise
            {
                string dosyaadi = Path.GetFileName(Request.Files[0].FileName);
                string uzanti   = Path.GetExtension(Request.Files[0].FileName);
                string yol      = "~/Image/" + dosyaadi + uzanti;
                Request.Files[0].SaveAs(Server.MapPath(yol));
                p.PersonelGorsel = "/Image/" + dosyaadi + uzanti;
            }// bu kısımda personel resimlerini bilgisayardan seçtim
            c.Personels.Add(p);
            c.SaveChanges();

            return(RedirectToAction("Index"));
        }
示例#28
0
        static void Main(string[] args)
        {
            Personel insan1 = new Personel();

            Console.WriteLine("Personel ismini giriniz: ");
            insan1.Ad = Console.ReadLine();
            Console.WriteLine("Soyad giriniz: ");
            insan1.Soyad = Console.ReadLine();
            Console.WriteLine("İşe giriş yılını giriniz: ");
            insan1.Yıl = int.Parse(Console.ReadLine());

            insan1.Hesap = ((insan1.Yıl * insan1.katsayi) * insan1.maas);

            Console.WriteLine(insan1.PersonelBilgileri());
        }
        private ListViewItem PersonelToListViewItem(Personel personel)
        {
            string[] degerlerim =
            {
                personel.Ad,
                personel.Soyad,  personel.DogumTarihi.ToShortDateString(),
                personel.Telefon,
                personel.Email,
                personel.Departman.ToString()
            };
            ListViewItem item = new ListViewItem(degerlerim);

            item.Tag = personel;
            return(item);
        }
示例#30
0
        private void actionGorevIptal_Execute(object sender, SimpleActionExecuteEventArgs e)
        {
            objectSpace = Application.CreateObjectSpace();

            GorevOlustur gorev = objectSpace.GetObjectByKey <GorevOlustur>(((GorevOlustur)e.CurrentObject).Oid);

            gorev.Durum = EnumObjects.ProjeDurumType.atanmadi;

            Personel personel = objectSpace.GetObjects <Personel>().Where(m => m.Kullanici.Oid == ((Guid)SecuritySystem.CurrentUserId)).FirstOrDefault();

            gorev.Alan = null;

            objectSpace.CommitChanges();
            ObjectSpace.Refresh();
        }