public ActionResult AddDepartman(int DepartmanNo, string kullaniciAdi) { var addedDBUserDepartman = new DBUsersDepartman { Kullanici_Adi = kullaniciAdi, Departman_No = DepartmanNo }; _dBUsersDepartman.AddDBUsersDepartman(addedDBUserDepartman); foreach (var altDepartman in _altDepartmanService.GetAllAltDepartman(x => x.Departman_No == DepartmanNo)) { var addedDBUserAltDepartman = new DBUsersAltDepartman { Kullanici_Adi = kullaniciAdi, Departman_No = DepartmanNo, Alt_Departman_No = altDepartman.Alt_Departman_No }; _dBUsersAltDepartmanService.AddDBUsersAltDepartman(addedDBUserAltDepartman); } foreach (var bolum in _bolumService.GetAllBolum(x => x.Departman_No == DepartmanNo)) { var addedDBUserBolum = new DBUsersBolum { Kullanici_Adi = kullaniciAdi, Departman_No = DepartmanNo, Alt_Departman_No = bolum.Alt_Departman_No, Bolum_No = bolum.Bolum_No }; _dBUsersBolumService.AddDBUsersBolum(addedDBUserBolum); } return(Json("Ok", JsonRequestBehavior.AllowGet)); }
public ActionResult Create(Departmanlar departmanlar) { if (permissionUser.SysAdmin == false) { throw new Exception("Yetkisiz Erişim!"); } else { if (ModelState.IsValid) { if (departmanlar.Adi != null) { var ID = _departmanService.GetAllDepartmanlar().Count; if (ID == 0) { _departmanService.DeleteAll(); } _departmanService.AddDepartman(departmanlar); foreach (var dbSysAdmin in _dBUsersService.GetAllDBUsers(x => x.SysAdmin == true)) { var dbUserDepartman = new DBUsersDepartman { Kullanici_Adi = dbSysAdmin.Kullanici_Adi, Departman_No = departmanlar.Departman_No }; _dBUsersDepartmanService.AddDBUsersDepartman(dbUserDepartman); } _accessDatasService.AddOperatorLog(190, user.Kullanici_Adi, departmanlar.Departman_No, 0, 0, 0); return(RedirectToAction("Index")); } } return(RedirectToAction("Index")); } }
public void DeleteDBUsersDepartman(DBUsersDepartman dBUsersDepartman) { _dBUsersDepartmanDal.Delete(dBUsersDepartman); }
public DBUsersDepartman UpdateDBUsersDepartman(DBUsersDepartman dBUsersDepartman) { return(_dBUsersDepartmanDal.Update(dBUsersDepartman)); }
public DBUsersDepartman AddDBUsersDepartman(DBUsersDepartman dBUsersDepartman) { return(_dBUsersDepartmanDal.Add(dBUsersDepartman)); }