Esempio n. 1
0
        // Return to view after updating.
        public ActionResult Edit(Contact c)
        {
            ContactBAL db = new ContactBAL();

            db.Update(c);
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
        // Return to view after adding a record.
        public ActionResult Create(Contact p)
        {
            ContactBAL db = new ContactBAL();

            db.add(p);
            return(RedirectToAction("Index"));
        }
Esempio n. 3
0
        // Update a record
        public ActionResult Edit(int id)
        {
            ContactBAL db     = new ContactBAL();
            var        record = db.Details(id);

            return(View(record));
        }
Esempio n. 4
0
        // View details of a single record.
        public ActionResult Details(int id)
        {
            ContactBAL db            = new ContactBAL();
            var        currentRecord = db.Details(id);

            return(View(currentRecord));
        }
Esempio n. 5
0
        public ActionResult Index()
        {
            ContactBAL CB      = new ContactBAL();
            var        records = CB.GetAll();

            return(View(records));
        }
Esempio n. 6
0
        // Return to view after deleting.
        public ActionResult Delete(int id)
        {
            ContactBAL db = new ContactBAL();

            db.DeleteRecord(id);

            return(RedirectToAction("Index"));
        }
Esempio n. 7
0
        public ActionResult Edit(ContactRec p)
        {
            ContactBAL CB = new ContactBAL();

            CB.Update(p);

            return(RedirectToAction("Index"));
        }
Esempio n. 8
0
        public ActionResult Delete(int id)
        {
            ContactBAL CB = new ContactBAL();

            CB.Delete(id);

            return(RedirectToAction("Index"));
        }
Esempio n. 9
0
        public ActionResult Create(ContactRec p)
        {
            ContactBAL CB = new ContactBAL();

            CB.Add(p);

            return(RedirectToAction("Index"));
        }
Esempio n. 10
0
 public ContactController(IOptions <Common.Configuration.Connection> connection, IOptions <Common.Configuration.Setting> settings)
 {
     ContactBAL = new BAL.ContactBAL(connection.Value, settings.Value);
 }