private void bttn_teslimalan_teslimet_Click(object sender, EventArgs e)
 {
     if (cb_book_selectbook.SelectedIndex == -1)
     {
         _ = new uc_alertbox("İşlem yapılacak kitap seçilmemiş.", uc_alertbox.AlertType.Error, this); return;
     }
     if (cb_book_selectbarcod.Text == "<kitap seçilmemiş>" || cb_book_selectbarcod.Text == "<barkot numarası seçin>")
     {
         _ = new uc_alertbox("Aynı ada sahip başka bir kitap mevcut. Barkot numarasını listeden seçin.", uc_alertbox.AlertType.Error, this); return;
     }
     AssignmentService.Modify(new Assignment()
     {
         Id         = AssignmentService.GetMAX(f => f.Barcod == Convert.ToInt64(cb_book_selectbarcod.SelectedItem)).Id,
         UserId     = AssignmentService.GetMAX(f => f.Barcod == Convert.ToInt64(cb_book_selectbarcod.SelectedItem)).UserId,
         Barcod     = Convert.ToInt64(cb_book_selectbarcod.SelectedItem),
         ReturnDate = (int)(DateTime.Now.Subtract(new DateTime(1970, 1, 1))).TotalSeconds,
         DealedDate = AssignmentService.GetMAX(f => f.Barcod == Convert.ToInt64(cb_book_selectbarcod.SelectedItem)).DealedDate,
         AssignDate = AssignmentService.GetMAX(f => f.Barcod == Convert.ToInt64(cb_book_selectbarcod.SelectedItem)).AssignDate,
         Notes      = tb_teslimeden_ekstranot.Text,
         Statu      = 0
     });
     BookService.Modify(new Book()
     {
         Id     = BookService.Get(p => p.Barcod == Convert.ToInt64(cb_book_selectbarcod.SelectedItem)).Id,
         RCount = BookService.Get(p => p.Barcod == Convert.ToInt64(cb_book_selectbarcod.SelectedItem)).RCount + 1,
         Name   = BookService.Get(p => p.Barcod == Convert.ToInt64(cb_book_selectbarcod.SelectedItem)).Name,
         Author = BookService.Get(p => p.Barcod == Convert.ToInt64(cb_book_selectbarcod.SelectedItem)).Author,
         Barcod = BookService.Get(p => p.Barcod == Convert.ToInt64(cb_book_selectbarcod.SelectedItem)).Barcod,
         Statu  = 0,
     });
     _ = new uc_alertbox("Kitap teslim alındı!", uc_alertbox.AlertType.Success, this);
     LoadBooks();
 }
 private void Bttn_kitap_degistir_Click(object sender, EventArgs e)
 {
     if (cb_book_selectbook.SelectedItem.ToString() == "kitap seç")
     {
         _ = new uc_alertbox("Düzenlenecek kitabı seçin.", uc_alertbox.AlertType.Error, this); return;
     }
     if (cb_book_selectbarcod.Text == "<kitap seçilmemiş>" || cb_book_selectbarcod.Text == "<barkot numarası seçin>")
     {
         _ = new uc_alertbox("Aynı ada sahip başka bir kitap mevcut. Barkot numarasını listeden seçin.", uc_alertbox.AlertType.Error, this); return;
     }
     if (tb_kitap_duzenle_ad.Text == "")
     {
         _ = new uc_alertbox("Kitap adı alanı boş olamaz.", uc_alertbox.AlertType.Error, this); return;
     }
     if (tb_kitap_duzenle_yazar.Text == "")
     {
         _ = new uc_alertbox("Yazar adı alanı boş olamaz.", uc_alertbox.AlertType.Error, this); return;
     }
     BookService.Modify(new Book()
     {
         Id = BookService.Get(p => p.Barcod == Convert.ToInt64(cb_book_selectbarcod.SelectedItem)).Id, Author = tb_kitap_duzenle_yazar.Text, Name = tb_kitap_duzenle_ad.Text, Barcod = BookService.Get(p => p.Barcod == Convert.ToInt64(cb_book_selectbarcod.SelectedItem)).Barcod, Statu = BookService.Get(p => p.Barcod == Convert.ToInt64(cb_book_selectbarcod.SelectedItem)).Statu
     });
     _ = new uc_alertbox("Kitap bilgileri güncellendi!", uc_alertbox.AlertType.Success, this);
     tb_kitap_duzenle_ad.Text = ""; tb_kitap_duzenle_yazar.Text = "";
     LoadBooks();
 }
Пример #3
0
 private void Bttn_kullanici_bilgidegistir_Click(object sender, EventArgs e)
 {
     if (cb_user_select_branch.Text == "<branş / kullanıcı türü seç>" || cb_user_select_branch.SelectedIndex == -1)
     {
         _ = new uc_alertbox("Branş seçimi yapmalısın.", uc_alertbox.AlertType.Error, this); return;
     }
     if (cb_user_select_user.Text == "<kullanıcı seç>" || cb_user_select_user.Text == "<kayıt yok>" && cb_user_select_user.SelectedIndex == -1)
     {
         _ = new uc_alertbox("Düzenlenecek kullanıyı seçmelisin!", uc_alertbox.AlertType.Error, this); return;
     }
     if (tb_kullanici_isim.Text == "" || tb_kullanici_isim.Text.Length < 3)
     {
         _ = new uc_alertbox("Kullanıcı adı boş olamaz veya üç karakterden kısa olamaz.", uc_alertbox.AlertType.Error, this); return;
     }
     if (UserService.Get(f => f.BranchId == BranchService.Get(p => p.Name == cb_user_select_branch.SelectedItem.ToString()).Id&& f.Name == tb_kullanici_isim.Text) != null)
     {
         _ = new uc_alertbox("Aynı ada ve branşa kayıtlı  bir kullanıcı bulundu.", uc_alertbox.AlertType.Warning, this); return;
     }
     UserService.Modify(new User()
     {
         Id        = UserService.Get(p => p.BranchId == BranchService.Get(s => s.Name == cb_user_select_branch.SelectedItem.ToString()).Id&& p.Name == cb_user_select_user.SelectedItem.ToString()).Id,
         Name      = tb_kullanici_isim.Text,
         BranchId  = BranchService.Get(p => p.Name == cb_user_select_branch.SelectedItem.ToString()).Id,
         ReadBooks = UserService.Get(p => p.BranchId == BranchService.Get(s => s.Name == cb_user_select_branch.SelectedItem.ToString()).Id&& p.Name == cb_user_select_user.SelectedItem.ToString()).ReadBooks
     });
     _ = new uc_alertbox(String.Format("{0} adlı kullanıcının adı {1} olarak değiştirildi!", cb_user_select_user.Text, tb_kullanici_isim.Text), uc_alertbox.AlertType.Success, this);
     LoadItems();
 }
Пример #4
0
 private void bttn_brans_ekle_Click(object sender, EventArgs e)
 {
     if (tb_branch_name.Text == "" || tb_branch_name.Text.Length < 3)
     {
         _ = new uc_alertbox("Branşın ismi boş olamaz ve üç karakterden kısa olamaz.", uc_alertbox.AlertType.Error, this); return;
     }
     if (cb_branch_select.FindStringExact(tb_branch_name.Text) == 0)
     {
         _ = new uc_alertbox("Aynı ada sahip bir branş bulundu.", uc_alertbox.AlertType.Warning, this); return;
     }
     BranchService.Add(new Branch()
     {
         Name = tb_branch_name.Text
     });
     _ = new uc_alertbox(string.Format("{0} adlı yeni branş başarıyla eklendi!", tb_branch_name.Text), uc_alertbox.AlertType.Success, this);
     LoadItems();
 }
Пример #5
0
 private void Bttn_kullanici_ekle_Click(object sender, EventArgs e)
 {
     if (tb_kullanici_isim.Text == "" || tb_kullanici_isim.Text.Length < 3)
     {
         _ = new uc_alertbox("Kullanıcı adı boş olamaz ve üç karakterden kısa olamaz.", uc_alertbox.AlertType.Error, this); return;
     }
     if (cb_user_select_branch.Text == "<branş / kullanıcı türü seç>" || cb_user_select_branch.SelectedItem.ToString() == "<kayıt yok>" || cb_user_select_branch.SelectedIndex == -1)
     {
         _ = new uc_alertbox("Branş seçimi yapmalısın.", uc_alertbox.AlertType.Error, this); return;
     }
     if (UserService.Get(f => f.BranchId == BranchService.Get(p => p.Name == cb_user_select_branch.SelectedItem.ToString()).Id&& f.Name == tb_kullanici_isim.Text) != null)
     {
         _ = new uc_alertbox("Aynı ada ve branşa kayıtlı  bir kullanıcı bulundu.", uc_alertbox.AlertType.Warning, this); return;
     }
     UserService.Add(new User()
     {
         Name = tb_kullanici_isim.Text, BranchId = BranchService.Get(p => p.Name == cb_user_select_branch.SelectedItem.ToString()).Id
     });
     _ = new uc_alertbox(string.Format("{0} adlı yeni kullanıcı {1} branşı ile başarıyla eklendi!", tb_kullanici_isim.Text, cb_user_select_branch.SelectedItem.ToString()), uc_alertbox.AlertType.Success, this);
     LoadItems();
 }
Пример #6
0
 private void Bttn_brans_degistir_Click(object sender, EventArgs e)
 {
     if (cb_branch_select.SelectedText == "branş / kullanıcı türü seç")
     {
         _ = new uc_alertbox("Branş adı değiştirmek için bir branş seçmelisin!", uc_alertbox.AlertType.Error, this); return;
     }
     if (tb_branch_name.Text == "" || tb_branch_name.Text.Length < 3)
     {
         _ = new uc_alertbox("Branşın ismi boş olamaz ve üç karakterden kısa olamaz.", uc_alertbox.AlertType.Error, this); return;
     }
     if (cb_branch_select.FindStringExact(tb_branch_name.Text) == 0)
     {
         _ = new uc_alertbox("Aynı ada sahip bir branş bulundu.", uc_alertbox.AlertType.Warning, this); return;
     }
     BranchService.Modify(new Branch()
     {
         Id = BranchService.Get(p => p.Name == cb_branch_select.SelectedItem.ToString()).Id, Name = tb_branch_name.Text
     });
     _ = new uc_alertbox(string.Format("{0} adlı branşın adı {1} olarak değiştirildi!", cb_branch_select.SelectedItem.ToString(), tb_branch_name.Text), uc_alertbox.AlertType.Success, this);
     LoadItems();
 }
Пример #7
0
 private void bttn_teslimalan_teslimet_Click_1(object sender, EventArgs e)
 {
     if (cb_book_selectbook.SelectedIndex == -1)
     {
         _ = new uc_alertbox("İşlem yapılacak kitap seçilmemiş.", uc_alertbox.AlertType.Error, this); return;
     }
     if (cb_book_selectbarcod.Text == "<kitap seçilmemiş>" || cb_book_selectbarcod.Text == "<barkod seçin>")
     {
         _ = new uc_alertbox("Aynı ada sahip başka bir kitap mevcut. Barkot numarasını listeden seçin.", uc_alertbox.AlertType.Error, this); return;
     }
     if (cb_user_selectuser.Text == "<branş seçilmemiş>" || cb_user_selectuser.Text == "<kayıt yok>")
     {
         _ = new uc_alertbox("Kitabın kime teslim edileceği seçilmemiş.", uc_alertbox.AlertType.Error, this); return;
     }
     if (cb_user_selectbranch.SelectedIndex == -1)
     {
         _ = new uc_alertbox("Teslim alan kişinin branşı seçilmemiş.", uc_alertbox.AlertType.Error, this); return;
     }
     AssignmentService.Add(new Assignment()
     {
         UserId     = UserService.Get(p => p.BranchId == BranchService.Get(f => f.Name == cb_user_selectbranch.SelectedItem.ToString()).Id&& p.Name == cb_user_selectuser.SelectedItem.ToString()).Id,
         Barcod     = Convert.ToInt64(cb_book_selectbarcod.SelectedItem),
         Notes      = tb_teslimalan_ekstranot.Text,
         AssignDate = (int)(DateTime.Now.Subtract(new DateTime(1970, 1, 1))).TotalSeconds,
         DealedDate = (int)(dtp_teslimalan.Value.Subtract(new DateTime(1970, 1, 1))).TotalSeconds,
         Statu      = 1
     });
     BookService.Modify(new Book()
     {
         Id     = BookService.Get(p => p.Barcod == Convert.ToInt64(cb_book_selectbarcod.SelectedItem)).Id,
         RCount = BookService.Get(p => p.Barcod == Convert.ToInt64(cb_book_selectbarcod.SelectedItem)).RCount + 1,
         Name   = BookService.Get(p => p.Barcod == Convert.ToInt64(cb_book_selectbarcod.SelectedItem)).Name,
         Author = BookService.Get(p => p.Barcod == Convert.ToInt64(cb_book_selectbarcod.SelectedItem)).Author,
         Barcod = BookService.Get(p => p.Barcod == Convert.ToInt64(cb_book_selectbarcod.SelectedItem)).Barcod,
         Statu  = 1,
     });
     _ = new uc_alertbox("Kitap teslim kaydı açıldı!", uc_alertbox.AlertType.Success, this);
     LoadBooks();
 }
 private void Bttn_kitap_ekle_Click(object sender, EventArgs e)
 {
     if (tb_kitap_isim.Text == "" || tb_kitap_isim.Text.Length < 3)
     {
         _ = new uc_alertbox("Girilen kitap adı geçersiz. En az üç karakterden oluşan bir kitap ismi girilmeli.", uc_alertbox.AlertType.Error, this); return;
     }
     if (tb_kitap_barkot.Text == "")
     {
         _ = new uc_alertbox("Girilen kitap adı geçersiz. En az üç karakterden oluşan bir kitap ismi girilmeli.", uc_alertbox.AlertType.Error, this); return;
     }
     if (BookService.Get(p => p.Barcod == Convert.ToInt64(tb_kitap_barkot.Text)) != null)
     {
         _ = new uc_alertbox("Aynı barkod numarası üzerine başka bir kitap bulundu. Farklı bir barkod girilmesi gerekmekte.", uc_alertbox.AlertType.Error, this); return;
     }
     BookService.Add(new Book()
     {
         Barcod = Convert.ToInt64(tb_kitap_barkot.Text), Name = tb_kitap_isim.Text, Author = tb_kitap_yazar.Text
     });
     _ = new uc_alertbox(string.Format("{0} adlı kitap başarıyla eklendi!", tb_kitap_isim.Text), uc_alertbox.AlertType.Success, this);
     tb_kitap_isim.Text = ""; tb_kitap_yazar.Text = ""; tb_kitap_barkot.Text = "";
     LoadBooks();
 }