コード例 #1
0
        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));
        }
コード例 #2
0
        private void buttonEditRecord_Click(object sender, EventArgs e)
        {
            ComplianceForm form = new ComplianceForm(complianceDirectiveControl.SelectedItem);

            form.RecordChanged += form_RecordChanged;
            form.ShowDialog();
        }
コード例 #3
0
        /// <summary>
        /// Добавляет техническую запись агрегата
        /// </summary>
        private void buttonAddCompliance_Click(object sender, EventArgs e)
        {
            ComplianceForm form = new ComplianceForm(currentDetail);

            form.RecordChanged += form_RecordChanged;
            form.ShowDialog();
        }
コード例 #4
0
 /// <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();
     }
 }
コード例 #5
0
        private void buttonDirectiveClosing_Click(object sender, EventArgs e)
        {
            ComplianceForm form = new ComplianceForm(directive);

            form.RecordType     = RecordTypesCollection.Instance.DirectiveClosingRecordType;
            form.RecordChanged += form_RecordChanged;
            form.ShowDialog();
        }
コード例 #6
0
ファイル: DirectiveScreen.cs プロジェクト: mkbiltek2019/Cas
        private void buttonAddNewRecord_Click(object sender, EventArgs e)
        {
            ComplianceForm form = new ComplianceForm(currentDirective);

            form.RecordType     = RecordTypesCollection.Instance.DirectivePerformanceRecordType;
            form.RecordChanged += form_RecordChanged;
            form.ShowDialog();
        }
コード例 #7
0
        public ActionResult DeleteConfirmed(int id)
        {
            ComplianceForm complianceForm = db.ComplianceForms.Find(id);

            db.ComplianceForms.Remove(complianceForm);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #8
0
        private void buttonEditRecord_Click(object sender, EventArgs e)
        {
            ComplianceForm form = new ComplianceForm(complianceDirectiveControl.SelectedItem);

            if (form.ShowDialog() == DialogResult.OK)
            {
                UpdateScreen();
            }
        }
コード例 #9
0
        private void buttonDirectiveClosing_Click(object sender, EventArgs e)
        {
            ComplianceForm form = new ComplianceForm(directive);

            form.RecordType = RecordTypesCollection.Instance.DirectiveClosingRecordType;
            if (form.ShowDialog() == DialogResult.OK)
            {
                UpdateScreen();
            }
        }
コード例 #10
0
ファイル: DirectiveScreen.cs プロジェクト: mkbiltek2019/Cas
        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();
        }
コード例 #11
0
        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));
        }
コード例 #12
0
        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));
        }
コード例 #13
0
        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));
        }