public ActionResult ConfirmPersonal(int id) { model.Personal = _personalService.Get(id); model.Personal.IsActive = true; bool result = _personalService.Update(model.Personal); return(RedirectToAction("ListPersonal", "Admin", model)); }
private void DepartmanComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { IPersonalService personalService = IocUtil.Resolve <IPersonalService>(); department = DepartmanComboBox.SelectedItem as Department; fillPersonalDataGrid(Convert.ToInt32(DepartmanComboBox.SelectedValue)); if (department != null && department.ManagerId != 0) { YoneticiText.Text = personalService.Get(department.ManagerId).Name + " " + personalService.Get(department.ManagerId).LastName; } }
public async Task <ActionResult> Edit(long?id) { if (id == null) { return(NotFound()); } Personal personal = await _personal.Get(x => x.PersonalId == id, PersonalInculude); if (personal == null) { return(NotFound()); } await Bind(); _model.Personal = personal; return(View("Create", _model)); }
public async Task <ActionResult> Edit(long?id) { if (!GetLoginUser().IsAdmin&& !GetLoginUser().IsCreate&& GetLoginUser().IsReader) { return(Unauthorized()); } if (id == null) { return(NotFound()); } Personal personal = await _personal.Get(x => x.PersonalId == id, PersonalInculude); if (personal == null) { return(NotFound()); } await Bind(); if (personal.Il != null) { var ilceList = await _utileService.GetIlces(personal.Il.IlId); _model.IlceList = ConvertSelectList(ilceList.Select(x => new { Id = x.IlceId, Value = x.IlceName })); } if (personal.KampIl != null) { var kampilceList = await _utileService.GetIlces(personal.KampIl.IlId); _model.KampIlceList = ConvertSelectList(kampilceList.Select(x => new { Id = x.IlceId, Value = x.IlceName })); } _model.Personal = personal; _model.SessionUser = GetLoginUser(); return(View("Create", _model)); }
public void AssignProduct() { IPersonalService personalService = IocUtil.Resolve <IPersonalService>(); IProductService productService = IocUtil.Resolve <IProductService>(); IWarehouseService warehouse = IocUtil.Resolve <IWarehouseService>(); Personal personal = personalService.Get(0); Product product = warehouse.GetProducts()[0]; productService.AssignProduct(personal, product); product = warehouse.GetProducts()[0]; Assert.AreEqual(personal.Id, product.AssignedById); }
public ActionResult Profil(int id) { Personal prs = _personalService.Get(id); return(View(prs)); }