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; }
public ActionResult AddAppointee(Appointee aptee) { aptee.CreatedOn = DateTime.Now; aptee.ModifiedOn = DateTime.Now; _AppointmentService.AddAppointee(aptee); return(View(aptee)); }
public void DelAppointee(int ID) { Appointee aptee = new Appointee(); aptee.ApteeID = ID; _AppointeeRepo.Remove(aptee); }
public Appointee ViewAppointee(int ID) { Appointee aptee = new Appointee(); aptee.ApteeID = ID; aptee = _AppointeeRepo.FindByID(aptee); return(aptee); }
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")); }
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(); } }
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)); }
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); }
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); }
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")); }
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)); }
public void AddDirect(Appointee aptee) { _AppointeeRepo.AddDirect(aptee); }
public void AddAppointee(Appointee aptee) { _AppointeeRepo.Add(aptee); }
public void DelAppointee(Appointee aptee) { _AppointeeRepo.Remove(aptee); }
public Appointee ViewAppointee(Appointee aptee) { throw new NotImplementedException(); }
public void DelAppointee(Appointee aptee) { Del <Appointee>("DelAppointee/" + aptee.ApteeID); }
public void AddDirect(Appointee aptee) { throw new NotImplementedException(); }
public void AddAppointee(Appointee aptee) { PostValues <Appointee>("AddAppointee", aptee); }
public Appointee ViewAppointee(Appointee aptee) { return _AppointeeRepo.FindByID(aptee); }
public void AddDirect(Appointee aptee) { //not implemented }