public ActionResult Edit([Bind(Include = "ComplianceFormID,Name,ComplianceCategoryID")] ComplianceForm complianceForm) // [HttpPost, ActionName("Edit")] // [ValidateAntiForgeryToken] // public ActionResult EditPost(int? id) { // if (id == null) // { // return new HttpStatusCodeResult(HttpStatusCode.BadRequest); // } // var complianceformToUpdate = db.ComplianceForm.Find(id); // if (TryUpdateModel(complianceformToUpdate, "", new string[] { "ComplianceFormID,Name,ProductID" })) // { // try // { // db.SaveChanges(); // return RedirectToAction("Index"); // } // catch (RetryLimitExceededException /* dex */) // { //Log the error (uncomment dex variable name and add a line here to write a log. // ModelState.AddModelError("", "Unable to save changes. Try again, and if the problem persists, see your system administrator."); // } // } // PopulateComplianceCategoryDropDownList(complianceformToUpdate.ComplianceFormID); // return View(complianceformToUpdate); if (ModelState.IsValid) { db.Entry(complianceForm).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(complianceForm)); }
private void buttonEditRecord_Click(object sender, EventArgs e) { ComplianceForm form = new ComplianceForm(complianceDirectiveControl.SelectedItem); form.RecordChanged += form_RecordChanged; form.ShowDialog(); }
/// <summary> /// Добавляет техническую запись агрегата /// </summary> private void buttonAddCompliance_Click(object sender, EventArgs e) { ComplianceForm form = new ComplianceForm(currentDetail); form.RecordChanged += form_RecordChanged; form.ShowDialog(); }
/// <summary> /// Редактирует техничесую запись агрегата /// </summary> private void buttonEditRecord_Click(object sender, EventArgs e) { if (complianceControl.SelectedItem == null) { return; } if (complianceControl.SelectedItem.RecordType == RecordTypesCollection.Instance.TransferType) { TransferRecordForm form = new TransferRecordForm(currentDetail, (TransferRecord)complianceControl.SelectedItem); form.RecordChanged += form_RecordChanged; form.ShowDialog(); } else if (complianceControl.SelectedItem.RecordType == RecordTypesCollection.Instance.ActualStateRecordType) { ActualStateRecordForm form = new ActualStateRecordForm((ActualStateRecord)complianceControl.SelectedItem); form.RecordChanged += form_RecordChanged; form.ShowDialog(); } else { ComplianceForm form = new ComplianceForm((DirectiveRecord)complianceControl.SelectedItem); form.RecordChanged += form_RecordChanged; form.ShowDialog(); } }
private void buttonDirectiveClosing_Click(object sender, EventArgs e) { ComplianceForm form = new ComplianceForm(directive); form.RecordType = RecordTypesCollection.Instance.DirectiveClosingRecordType; form.RecordChanged += form_RecordChanged; form.ShowDialog(); }
private void buttonAddNewRecord_Click(object sender, EventArgs e) { ComplianceForm form = new ComplianceForm(currentDirective); form.RecordType = RecordTypesCollection.Instance.DirectivePerformanceRecordType; form.RecordChanged += form_RecordChanged; form.ShowDialog(); }
public ActionResult DeleteConfirmed(int id) { ComplianceForm complianceForm = db.ComplianceForms.Find(id); db.ComplianceForms.Remove(complianceForm); db.SaveChanges(); return(RedirectToAction("Index")); }
private void buttonEditRecord_Click(object sender, EventArgs e) { ComplianceForm form = new ComplianceForm(complianceDirectiveControl.SelectedItem); if (form.ShowDialog() == DialogResult.OK) { UpdateScreen(); } }
private void buttonDirectiveClosing_Click(object sender, EventArgs e) { ComplianceForm form = new ComplianceForm(directive); form.RecordType = RecordTypesCollection.Instance.DirectiveClosingRecordType; if (form.ShowDialog() == DialogResult.OK) { UpdateScreen(); } }
private void buttonEditRecord_Click(object sender, EventArgs e) { if (complianceDirectiveControl.SelectedItem.RecordType == RecordTypesCollection.Instance.TransferType) { return; } ComplianceForm form = new ComplianceForm(complianceDirectiveControl.SelectedItem); form.RecordChanged += form_RecordChanged; form.ShowDialog(); }
public ActionResult Create([Bind(Include = "ComplianceFormID,Name,ComplianceCategoryID")] ComplianceForm complianceForm) { if (ModelState.IsValid) { db.ComplianceForms.Add(complianceForm); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ComplianceCategoryID = new SelectList(db.ComplianceCategory, "ComplianceCategoryID", "Name", complianceForm.ComplianceCategoryID); return(View(complianceForm)); }
public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ComplianceForm complianceForm = db.ComplianceForms.Find(id); if (complianceForm == null) { return(HttpNotFound()); } return(View(complianceForm)); }
public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ComplianceForm complianceForm = db.ComplianceForms.Find(id); if (complianceForm == null) { return(HttpNotFound()); } ViewBag.ComplianceCategoryID = new SelectList(db.ComplianceCategory, "ComplianceCategoryID", "Name", complianceForm.ComplianceCategoryID); return(View(complianceForm)); }