Example #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;
        }
Example #2
0
 public ActionResult AddAppointee(Appointee aptee)
 {
     aptee.CreatedOn  = DateTime.Now;
     aptee.ModifiedOn = DateTime.Now;
     _AppointmentService.AddAppointee(aptee);
     return(View(aptee));
 }
Example #3
0
        public void DelAppointee(int ID)
        {
            Appointee aptee = new Appointee();

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

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

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