public async Task <IActionResult> Edit(int id, [Bind("Id,Code,DescriptionRU,DescriptionKK,DescriptionEN")] Otdel otdel) { if (id != otdel.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(otdel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!OtdelExists(otdel.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(otdel)); }
public async Task <ActionResult> DeleteConfirmed(int id) { Otdel otdel = await db.Otdels.FindAsync(id); db.Otdels.Remove(otdel); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
/// <summary> /// Подписка на изменение Отдел /// </summary> /// <param name="otdel">Отдел</param> public static void SubscribeOtdel(Otdel otdel) { IHubContext context = GlobalHost.ConnectionManager.GetHubContext <SignalRinventory>(); Loggers.Log4NetLogger.Info(new Exception("Модель Отдела рассылка пошла: " + otdel.IdOtdel + " " + otdel.NameOtdel)); SerializeJson json = new SerializeJson(); context.Clients.All.SubscribeOtdel(json.JsonLibaryIgnoreDate(otdel)); }
public void RemoveOtdel(int otdelId) { Otdel otdel = _otdelRepository.GetId(otdelId); if (otdel != null) { _otdelRepository.Delete(otdelId); _otdelRepository.Save(); } }
public async Task <ActionResult> Edit([Bind(Include = "Id,Code,Description")] Otdel otdel) { if (ModelState.IsValid) { db.Entry(otdel).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(otdel)); }
public async Task <IActionResult> Create([Bind("Id,Code,DescriptionRU,DescriptionKK,DescriptionEN")] Otdel otdel) { if (ModelState.IsValid) { _context.Add(otdel); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(otdel)); }
public async Task <ActionResult> Create([Bind(Include = "Id,Code,Description")] Otdel otdel) { if (ModelState.IsValid) { db.Otdels.Add(otdel); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(otdel)); }
public async Task <ActionResult> Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Otdel otdel = await db.Otdels.FindAsync(id); if (otdel == null) { return(HttpNotFound()); } return(View(otdel)); }
public void CreateWord(WordprocessingDocument package, Otdel templateotdel, SenderUsers senders, object obj) { MainDocumentPart mainDocumentPart = package.AddMainDocumentPart(); DocumentFormat.OpenXml.Wordprocessing.Document document = new DocumentFormat.OpenXml.Wordprocessing.Document(); PageSetting settingpage = new PageSetting(); DocumentsFull documentInvoce = new DocumentsFull(); document.Append(settingpage.ParametrPageHorizontEditMargin(new PageMargin() { Top = 300, Right = 794, Bottom = 100, Left = 794, Header = 300, Footer = 700U, Gutter = 0U })); document.Append(documentInvoce.GenerateRuleUserTemplate(templateotdel, senders)); mainDocumentPart.Document = document; }
public void UpdateOtdel(Otdel otdel) { _otdelRepository.Update(otdel); _otdelRepository.Save(); }
public void CreateOtdel(Otdel otdel) { _otdelRepository.Create(otdel); _otdelRepository.Save(); }
public void Put([FromBody] Otdel otdel) { _otdelService.UpdateOtdel(otdel); }
public void Post([FromBody] Otdel otdel) { _otdelService.CreateOtdel(otdel); }