SigTrade.Models.PhaseRepository.save C# (CSharp) Méthode

save() public méthode

public save ( Phase p ) : int
p Phase
Résultat int
        public int save(Phase p)
        {
            return DB.Save(p);
        }

Usage Example

        //PROCESS EDIT AND CREATE FORMS
        private ActionResult phaseFormProcess(Phase phase, PhaseRepository phase_rep, FormCollection collection)
        {
            try
            {

                phase.PhaseDesc = collection["phase_description"];
                phase.PhaseStartDate = DateTime.Parse(collection["start_date"]);
                phase.Deleted = false;
                phase_rep.save(phase);

                TempData["flash"] = "Phase: " + phase.PhaseDesc;
                return RedirectToAction("Index");
            }
            catch (Exception exception)
            {
                throw new Exception("A data entry problem has occurred.");
            }
        }