public ActionResult UpdateCustomer(int CustomerID) { Services.CustomerService CustomerService = new Services.CustomerService(); Models.Customer Customer = CustomerService.GetCustomerByID(CustomerID); ViewBag.Customer = Customer; return(View()); }
public void ShouldCallDatabaseToGetAllCustomers() { var mockDatabase = new Mock <ICustomerDb>(); var sut = new Services.CustomerService(mockDatabase.Object); sut.GetAll(); mockDatabase.Verify(db => db.GetAll(), Times.Once); }
public void ShouldCallDatabaseToGetCustomerById() { var mockDatabase = new Mock <ICustomerDb>(); var sut = new Services.CustomerService(mockDatabase.Object); sut.GetById(It.IsAny <string>()); mockDatabase.Verify(db => db.GetById(It.IsAny <string>()), Times.Once); }
public CodeController(DbContext.CHISEntitiesSqlServer db , Services.DrugService drugsvr , Services.CustomerService cusSvr , Services.DoctorService docrSvr ) : base(db) { _drugSvr = drugsvr; _cusSvr = cusSvr; _docrSvr = docrSvr; }
public object GetService(Type serviceType) { if (serviceType == typeof(CustomerController)) { var customerSvc = new Services.CustomerService(); var controller = new Controllers.CustomerController(customerSvc); return(controller); } return(null); }
public object GetService(Type serviceType) { if (serviceType == typeof(CustomerController)) { var customerSvc = new Services.CustomerService(); var controller = new Controllers.CustomerController(customerSvc); return controller; } return null; }
public void ShouldCallDatabaseToInsertCustomer() { var newCustomer = new Models.Customer(NewCustomerEmail, NewCustomerFirstName, NewCustomerSurname, NewCustomerPassword); var mockDatabase = new Mock <ICustomerDb>(); var sut = new Services.CustomerService(mockDatabase.Object); sut.Add(newCustomer); mockDatabase.Verify(db => db.Insert(newCustomer), Times.Once); }
public HealthorController(Services.ReservationService resSvr, Services.WorkStationService stationSvr, Services.DoctorService docrSvr, Services.CustomerService cusSvr ) //: base(db) { _resSvr = resSvr; _stationSvr = stationSvr; _cusSvr = cusSvr; _docrSvr = docrSvr; }
public HealthorController(DbContext.CHISEntitiesSqlServer db, Services.ReservationService resSvr, Services.WorkStationService stationSvr, Services.DoctorService docrSvr, Services.CustomerService cusSvr ) : base(db) { _resSvr = resSvr; _stationSvr = stationSvr; _cusSvr = cusSvr; _docrSvr = docrSvr; }
public void ShouldReturnCustomerWithTheSameEmailPassedIntoIt() { var newCustomer = new Models.Customer(NewCustomerEmail, NewCustomerFirstName, NewCustomerSurname, NewCustomerPassword); var mockDatabase = new Mock <ICustomerDb>(); mockDatabase.Setup(db => db.Insert(newCustomer)).ReturnsAsync(newCustomer); var sut = new Services.CustomerService(mockDatabase.Object); var actualNewCustomer = sut.Add(newCustomer).Result; Assert.Equal(NewCustomerEmail, actualNewCustomer.Email); }
public JsonResult DoInsertCustomer(Models.Customer Customer) { try { Services.CustomerService CustomerService = new Services.CustomerService(); JsonResult result = this.Json(CustomerService.InsertCustomer(Customer), JsonRequestBehavior.AllowGet); return(result); } catch (Exception) { return(this.Json(false)); } }
public JsonResult Read(Models.CustomerSearch Arg) { try { Services.CustomerService CustomerService = new Services.CustomerService(); JsonResult result = this.Json(CustomerService.GetCustomer(Arg), JsonRequestBehavior.AllowGet); return(result); } catch (Exception) { return(this.Json(false)); } }
public JsonResult GetContactTitle() { try { Services.CustomerService CustomerService = new Services.CustomerService(); JsonResult result = this.Json(CustomerService.GetContactTitle(), JsonRequestBehavior.AllowGet); return(result); } catch (Exception) { return(this.Json(false)); } }
public HealthorInfo(DbContext.CHISEntitiesSqlServer db, Services.ReservationService resSvr, Services.WorkStationService stationSvr, Services.DoctorService docrSvr, Services.CustomerService cusSvr, Services.DispensingService dispSvr ) : base(db) { _resSvr = resSvr; _stationSvr = stationSvr; _cusSvr = cusSvr; _dispSvr = dispSvr; }
public ReservateController(Services.ReservationService resSvr , Services.WorkStationService stationSvr , Services.DoctorService docrSvr , Services.CustomerService cusSvr , Services.WeChatService wechatSvr ) //: base(db) { _resSvr = resSvr; _stationSvr = stationSvr; _cusSvr = cusSvr; _docrSvr = docrSvr; _weChatSvr = wechatSvr; }
public NurseController(DbContext.CHISEntitiesSqlServer db , Services.CustomerService cusSvr , Services.WorkStationService staSvr , Services.DoctorService docSvr , Services.LoginService loginSvr , Services.RxService rxSvr ) : base(db) { _cusSvr = cusSvr; _staSvr = staSvr; _docSvr = docSvr; _loginSvr = loginSvr; _rxSvr = rxSvr; }
public StationController(Services.ReservationService resSvr, Services.WorkStationService stationSvr, Services.DoctorService docrSvr, Services.CustomerService cusSvr, Services.DrugService drugSvr, Services.DictService dicSvr ) //: base(db) { _resSvr = resSvr; _stationSvr = stationSvr; _cusSvr = cusSvr; _docrSvr = docrSvr; _drugSvr = drugSvr; _dicSvr = dicSvr; }
public void ShouldReturnTheSameCustomerWithTheSameEmail() { const string newCustomerEmail = "*****@*****.**"; const string newCustomerFirstName = "John"; const string newCustomerSurname = "Clarkin"; const string newCustomerPassword = "******"; var existingCustomer = new Models.Customer(newCustomerEmail, newCustomerFirstName, newCustomerSurname, newCustomerPassword); var mockDatabase = new Mock <ICustomerDb>(); mockDatabase.Setup(db => db.GetById(It.IsAny <string>())).ReturnsAsync(existingCustomer); var sut = new Services.CustomerService(mockDatabase.Object); var actualNewCustomer = sut.GetById(It.IsAny <string>()).Result; Assert.Equal(newCustomerEmail, actualNewCustomer.Email); }
public DispensingController(Services.ReservationService resSvr, Services.WorkStationService stationSvr, Services.DoctorService docrSvr, Services.CustomerService cusSvr, Services.DrugService drugSvr, Services.DictService dicSvr , Services.DispensingService dispSvr , IMapper mapper ) //: base(db) { _resSvr = resSvr; _stationSvr = stationSvr; _cusSvr = cusSvr; _docrSvr = docrSvr; _drugSvr = drugSvr; _dicSvr = dicSvr; _dispSvr = dispSvr; _mapper = mapper; }
public JsonResult DeleteCustomer(string CustomerID) { try { Services.CustomerService CustomerService = new Services.CustomerService(); int result = CustomerService.DeleteCustomerByID(CustomerID); if (result >= 1) { return(this.Json(true)); } else { return(this.Json(false)); } } catch (Exception) { return(this.Json(false)); } }
public Customer(DbContext.CHISEntitiesSqlServer db, Services.CustomerService cusSvr, Services.FollowListService followListService) : base(db) { _cusSvr = cusSvr; _followListService = followListService; }
/// <summary> /// コンストラクタ /// </summary> public CustomerController() { this._service = new Services.CustomerService(); }
public CustomersController(Services.CustomerService customerService) { _customerService = customerService; }
public CustomerController() { _customerService = new Services.CustomerService(KioskoController.GetCustomerService()); }