Save() 공개 메소드

public Save ( MeetingLib m ) : int
m MeetingLib
리턴 int
예제 #1
0
        public static void UpdateMeetingLib(MeetingLib m, FormCollection collection)
        {
            IMeetingLibRepository MeetingLibRep = new MeetingLibRepository();

            m.MeetingLibDesc = collection["MeetingLibDesc"];
            m.MeetingLibNumber = collection["MeetingLibNumber"];
            m.MeetingLibDate = DateTime.Parse(collection["meeting_date"]);
            m.DateModified = DateTime.Now;
            

            MeetingLibRep.Save(m);
            return;
        }
예제 #2
0
        public void Adding_MeetingLib()
        {
            IMeetingLibRepository MeetingLibRep = new MeetingLibRepository();

            MeetingLib m = new MeetingLib();

            IList<SelectItems> allItems = new List<SelectItems>();
            allItems.ToPagedList(0, 10);

               m.MeetingLibDesc = "Plants";
            m.MeetingLibNumber = "PL01";
            m.MeetingLibDate = DateTime.Parse("02/02/2009");
            m.DateAdded = DateTime.Now;
            m.DateModified = DateTime.Now;

            int saved = MeetingLibRep.Save(m);
            Assert.AreEqual(saved, 3);
        }
예제 #3
0
        public void Update_Meeting_Lib()
        {
            IMeetingLibRepository MeetingLibRep = new MeetingLibRepository();

            MeetingLib m = MeetingLibRep.getMeetingLibByID(2);
            FormCollection form = new FormCollection();
            form["MeetingLibNumber"] = "x";
            form["MeetingLibDesc"] = "xy";
            form["MeetingLibDate"] = "01/01/2009";

            m.MeetingLibDesc = form["MeetingLibDesc"];
            m.MeetingLibNumber = form["MeetingLibNumber"];
            m.MeetingLibDate = DateTime.Parse(form["MeetingLibDate"]);

            MeetingLibRep.Save(m);

               Assert.AreEqual(MeetingLibRep.Save(m),0);
        }
예제 #4
0
        public void Modify_MeetingLib()
        {
            IMeetingLibRepository MeetingLibRep = new MeetingLibRepository();

            MeetingLib m = MeetingLibRep.getMeetingLibByID(2);

            m.MeetingLibDesc = "PLants Committee";
            m.DateModified = DateTime.Now;

            int saved = MeetingLibRep.Save(m);
            Assert.AreEqual(saved, 1);
        }
예제 #5
0
        public static void UpdateMeetingLib(MeetingLib m, FormCollection collection)
        {
            IMeetingLibRepository MeetingLibRep = new MeetingLibRepository();

            m.MeetingLibDesc = collection["MeetingLibDesc"];
            m.MeetingLibNumber = collection["MeetingLibNumber"];
            m.MeetingLibDate = DateTime.Parse(collection["meeting_date"]);
            m.DateModified = DateTime.Now;

            MeetingLibRep.Save(m);
            return;
        }
예제 #6
0
        public ActionResult Edit(int id, FormCollection collection)
        {
            try
            {
                // TODO: Add update logic here
                IMeetingLibRepository MeetingLibRep = new MeetingLibRepository();
                MeetingLib m = MeetingLibRep.getMeetingLibByID(id);

                m.MeetingLibDesc = collection["meeting_description"];
                m.MeetingLibNumber = collection["meeting_number"];
                m.MeetingLibDate = DateTime.Parse(collection["meeting_date"]);
                m.DateModified = DateTime.Now;

                MeetingLibRep.Save(m);

                return RedirectToAction("Index");
            }
            catch (SubSonic.SqlQueryException e)
            {
                Console.WriteLine("{0} Exception caught.", e.Message);
                IMeetingLibRepository MeetingLibRep = new MeetingLibRepository();
                MeetingLib m = MeetingLibRep.getMeetingLibByID(id);
                ViewData.Model = m;
                return View();
            }
        }