예제 #1
0
        public new void SetUp()
        {
            _AppointeeRepo = MockRepository.GenerateMock <ICommonRepository <Appointee> >();

            Appointee apt1 = new Appointee()
            {
                ApteeID   = 1,
                FirstName = "test1",
                LastName  = "demo1"
            };

            Appointee apt2 = new Appointee()
            {
                ApteeID   = 2,
                FirstName = "test2",
                LastName  = "demo2"
            };

            _AppointeeRepo.Expect(x => x.FindAll()).Return(new List <Appointee>()
            {
                apt1, apt2
            }.AsEnumerable());

            _AppointmentService = new AppointmentService();
            _AppointmentService.AppointeeRepo = _AppointeeRepo;
        }
예제 #2
0
 public ActionResult AddAppointee(Appointee aptee)
 {
     aptee.CreatedOn  = DateTime.Now;
     aptee.ModifiedOn = DateTime.Now;
     _AppointmentService.AddAppointee(aptee);
     return(View(aptee));
 }
예제 #3
0
        public void DelAppointee(int ID)
        {
            Appointee aptee = new Appointee();

            aptee.ApteeID = ID;
            _AppointeeRepo.Remove(aptee);
        }
예제 #4
0
        public Appointee ViewAppointee(int ID)
        {
            Appointee aptee = new Appointee();

            aptee.ApteeID = ID;
            aptee         = _AppointeeRepo.FindByID(aptee);

            return(aptee);
        }
예제 #5
0
        public ActionResult AllAppointee(AppointeeViewModel apvm)
        {
            Appointee aptee = new Appointee();

            aptee.FirstName  = apvm.FirstName;
            aptee.LastName   = apvm.LastName;
            aptee.CreatedOn  = DateTime.Now;
            aptee.ModifiedOn = DateTime.Now;
            _AppointmentService.AddAppointee(aptee);

            return(RedirectToAction("AllAppointee"));
        }
예제 #6
0
        protected void GRV1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "DelAppointee")
            {
                int       ID    = Convert.ToInt32(e.CommandArgument);
                Appointee aptee = new Appointee();
                aptee.ApteeID = ID;
                _AppointmentService.DelAppointee(aptee);

                BindGrid();
            }
        }
예제 #7
0
        public ActionResult DelAppointee(int ID)
        {
            Appointee aptee = new Appointee();

            aptee.ApteeID = ID;
            _AppointmentService.DelAppointee(aptee);


            AppointeeViewModel apvm = new AppointeeViewModel();

            apvm.lstAppointee = _AppointmentService.GetAllAppointee();
            return(View("../Appointments/Appointee", apvm));
        }
예제 #8
0
        public void AddAppointee(AppointeModel apteem)
        {
            var       context = HttpContext.Current;
            Appointee aptee   = new Appointee();

            aptee.FirstName  = apteem.FirstName;
            aptee.LastName   = apteem.LastName;
            aptee.CreatedOn  = DateTime.Now;
            aptee.ModifiedOn = DateTime.Now;

            _AppointeeRepo.Add(aptee);
            //OR
            //_AppointeeRepo.AddDirect(aptee);
        }
예제 #9
0
        void AddAppointee()
        {
            Appointee aptee = new Appointee();

            aptee.FirstName  = txtFirstName.Text.Trim();
            aptee.LastName   = txtLastName.Text.Trim();
            aptee.CreatedOn  = DateTime.Now;
            aptee.ModifiedOn = null;
            _AppointmentService.AddAppointee(aptee);

            //dynamic items = new ExpandoObject();
            //items.FirstName = txtFirstName.Text.Trim();
            //items.LastName = txtLastName.Text.Trim();
            //_AppointmentService.AddOther(items);
        }
예제 #10
0
        public ActionResult AllAppointee(AppointeeViewModel apvm)
        {
            Appointee aptee = new Appointee();

            aptee.FirstName  = apvm.FirstName;
            aptee.LastName   = apvm.LastName;
            aptee.CreatedOn  = DateTime.Now;
            aptee.ModifiedOn = DateTime.Now;
            _AppointmentService.AddAppointee(aptee);

            //non common method (use dapper directly rahter than dapperextension)
            //_AppointmentService.AddDirect(aptee);

            return(RedirectToAction("AllAppointee"));
        }
예제 #11
0
        public ActionResult ViewAppointee(int ID)
        {
            Appointee aptee = new Appointee();

            aptee.ApteeID = ID;
            aptee         = _AppointmentService.ViewAppointee(aptee);

            if (aptee == null)
            {
                ViewBag.IsPresent = false;
            }
            else
            {
                ViewBag.IsPresent = true;
            }

            return(View("../Appointments/ViewAppointee", aptee));
        }
예제 #12
0
 public void AddDirect(Appointee aptee)
 {
     _AppointeeRepo.AddDirect(aptee);
 }
예제 #13
0
 public void AddAppointee(Appointee aptee)
 {
     _AppointeeRepo.Add(aptee);
 }
예제 #14
0
 public void DelAppointee(Appointee aptee)
 {
     _AppointeeRepo.Remove(aptee);
 }
예제 #15
0
 public Appointee ViewAppointee(Appointee aptee)
 {
     throw new NotImplementedException();
 }
예제 #16
0
 public void DelAppointee(Appointee aptee)
 {
     Del <Appointee>("DelAppointee/" + aptee.ApteeID);
 }
예제 #17
0
 public void AddDirect(Appointee aptee)
 {
     throw new NotImplementedException();
 }
예제 #18
0
 public void AddAppointee(Appointee aptee)
 {
     PostValues <Appointee>("AddAppointee", aptee);
 }
예제 #19
0
 public Appointee ViewAppointee(Appointee aptee)
 {
     return _AppointeeRepo.FindByID(aptee);
 }
예제 #20
0
 public void AddDirect(Appointee aptee)
 {
     //not implemented
 }