public ActionResult ProductConfirmationMail(string id) { ProductService productService = new ProductService(); CustomerService customerService = new CustomerService(); OfficeService officeService = new OfficeService(); Product product = productService.Get(id); Customer customer = customerService.Get(product.CustomerId); Office office = officeService.Get(product.OfficeIdFrom); MailMessage mail = new MailMessage(); mail.To.Add(customer.CustomerEmail); mail.From = new MailAddress("*****@*****.**"); mail.Subject = "Oder Confirmation"; string Body = "Dear <b>" + customer.CustomerName + ", </b><br/>" + "Thank you for choosing us. Please keep the following information...<br/>" + "<label>Product Code #: </label>" + product.ProductId + "<br/><label>Product Type : </label>" + product.ProductType + "<br/><label>Quantity : </label>" + product.ProductQuantity + "<br/><label>Total Weight : </label>" + product.ProductWeight + " Unit(s)" + "<br/><label>Shipping Cost : </label>" + product.SendingCost + " TK" + "<br/><label>Sending To : </label>" + customer.ReceiverName + "<br/><br/><b>For Any Query @Call : </b>" + office.OfficialNumber + "<br/>"; mail.Body = Body; mail.IsBodyHtml = true; SmtpClient smtp = new SmtpClient(); smtp.Host = "smtp.gmail.com"; smtp.Port = 587; smtp.UseDefaultCredentials = false; smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "debug1234"); // Enter seders User name and password smtp.EnableSsl = true; smtp.Send(mail); return(RedirectToAction("ProductFinalConfirmation", "Product", new { id = id })); }
public override async void OnNavigatingFrom(NavigatingFromEventArgs e, Dictionary <string, object> viewModelState, bool suspending) { if (IsEmailAction && e.NavigationMode == NavigationMode.Back && !_mailHasBeenSent) { await OfficeService.DeleteDraftMessage(Message.Id); } }
static void Main(string[] args) { var service = new OfficeService(); service.Convert(new TaskSetup("1000", @"/app/app/1.doc", @"/app/app")); Console.WriteLine("Hello World!"); }
public SimpleTestContainer() { var domainEventPublisher = new SimpleEventPublisher(); var uoW = new MemoryCarRentalUoW( new MemoryRepository <Driver>(), new MemoryRepository <Car>(), new MemoryRepository <Rental>(), new MemoryRepository <Office>() ); var freeMinutesPolicyFactory = new FreeMinutesPolicy(); var rentalFactory = new RentalFactory(domainEventPublisher); var carMapper = new CarMapper(); var driverMapper = new DriverMapper(); var rentalMapper = new RentalMapper(); var officeMapper = new OfficeMapper(); DriverService = new DriverService(uoW, driverMapper, domainEventPublisher); CarService = new CarService(uoW, carMapper, domainEventPublisher); RentalService = new RentalService(uoW, rentalMapper, domainEventPublisher, rentalFactory, freeMinutesPolicyFactory); FinishRentalService = new StopRentalService(uoW, domainEventPublisher); OfficeService = new OfficeService(uoW, officeMapper, domainEventPublisher); }
public ActionResult ReceiveConfirmationMail(string id) { ProductService productService = new ProductService(); CustomerService customerService = new CustomerService(); OfficeService officeService = new OfficeService(); Product product = productService.Get(id); Customer customer = customerService.Get(product.CustomerId); Office office = officeService.Get(product.OfficeIdFrom); MailMessage mail = new MailMessage(); mail.To.Add(customer.ReceiverEmail); mail.From = new MailAddress("*****@*****.**"); mail.Subject = "Product Received"; string Body = "Dear <b>" + customer.ReceiverName + ", </b><br/>" + "We just received a product for you that was send by " + customer.CustomerName + ".<br> Please come to our Office with the Product Code below and also bring your Phone 0" + customer.ReceiverPhoneNumber + ".<br/>" + "<b><label>Product Code #: </label>" + product.ProductId + "<b>" + "<br/><label>Product Type : </label>" + product.ProductType + "<br/><label>Quantity : </label>" + product.ProductQuantity + "<br/><label> Office Location : </label>" + office.Location + "<br/><br/><b>For Any Query @Call : </b>" + office.OfficialNumber + "<br/>"; mail.Body = Body; mail.IsBodyHtml = true; SmtpClient smtp = new SmtpClient(); smtp.Host = "smtp.gmail.com"; smtp.Port = 587; smtp.UseDefaultCredentials = false; smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "debug1234"); // Enter seders User name and password smtp.EnableSsl = true; smtp.Send(mail); @TempData["ReceivingMessage"] = " Successfully Received"; return(RedirectToAction("ReceiveProduct", "Product")); }
public ActionResult EditProfile(string Id, string temp) { if (Session["uname"] != null) { TempData["EditEmployeeId"] = Id; if (temp == "1") { ViewBag.Edit = "Yes"; } Employee employee = employeeRepository.Get(Id); OfficeService officeRepository = new OfficeService(); List <SelectListItem> officeList = new List <SelectListItem>(); SelectListItem init = new SelectListItem(); init.Text = "Please Select an Option"; init.Value = ""; officeList.Add(init); foreach (Office office in officeRepository.GetAll()) { SelectListItem option = new SelectListItem(); option.Text = office.OfficeId; option.Value = office.OfficeId; officeList.Add(option); } ViewBag.Offices = officeList; return(View(employee)); } return(RedirectToAction("Index", "Home")); }
public OfficeController(OfficeService OfficeService, CountryService countyser, CityService ctyservc, StateService staserv) { _OfficeService = OfficeService; _CountryService = countyser; _CityService = ctyservc; _StateService = staserv; }
public ActionResult Success(FilterModel model) { OrderService service = new OrderService(); OfficeService offservice = new OfficeService(); AccountService accservice = new AccountService(); OrderModel order = new OrderModel(); if (!String.IsNullOrEmpty(model.Name)) { var name = accservice.GetNameByUserID(Convert.ToInt32(model.Name)); var lstorder = service.GetFilter(name, model.OfficeName, model.FromDate, model.ToDate); order.Listorder = lstorder; } else { var lstorder = service.GetFilter(model.Name, model.OfficeName, model.FromDate, model.ToDate); order.Listorder = lstorder; } List <Office> lstoffname = offservice.GetOfficeName(); SelectList namelist = new SelectList(lstoffname, "", "OfficeName"); ViewBag.Listname = namelist; order.FromDate = model.FromDate; order.ToDate = model.ToDate; return(View(order)); }
public ActionResult Registration(string id) { if (Session["uname"] != null) { if (id == "1") { ViewBag.Reg = "Yes"; } OfficeService officeRepository = new OfficeService(); List <SelectListItem> officeList = new List <SelectListItem>(); SelectListItem init = new SelectListItem(); init.Text = "Please Select an Option"; init.Value = ""; officeList.Add(init); foreach (Office office in officeRepository.GetAll()) { SelectListItem option = new SelectListItem(); option.Text = office.OfficeId; option.Value = office.OfficeId; officeList.Add(option); } ViewBag.Offices = officeList; return(View()); } return(RedirectToAction("Index", "Home")); }
protected override async Task OnInitAsync() { this.Offices = await OfficeService.GetOffices(); if (this.Offices == null) { return; } this.SelectedOfficeId = this.Offices .Where(x => x.Selected) .Select(x => x.Id.Value) .FirstOrDefault(); if (SelectedOfficeId == default) { this.SelectedOfficeId = this.Offices .Select(x => x.Id.Value) .FirstOrDefault(); } this.ChangeOffice(new UIChangeEventArgs { Value = SelectedOfficeId }); await base.OnInitAsync(); }
void loadData() { OfficeService officeService = new OfficeService(new CoffeShopContext()); gridControl1.DataSource = officeService.GetAll(); btnDelete.Enabled = false; }
public ActionResult Edit(int ID) { OfficeService service = new OfficeService(); var office = service.Getbykey(ID); return(View(office)); }
public ActionResult CreateNew(Office office) { OfficeService service = new OfficeService(); service.CreateNew(office); return(RedirectToAction("Index", "Office")); }
private async void DoSendMail() { using (new Loading(this)) { _mailHasBeenSent = await OfficeService.UpdateAndSendMessage(Message, Comment, Recipients); } GoBack(); }
public override async void OnNavigatedTo(NavigatedToEventArgs e, Dictionary <string, object> viewModelState) { base.OnNavigatedTo(e, viewModelState); Contacts = null; _contactsCount = await OfficeService.GetContactsCount(); await GetFirstPage(); }
public CarAdminController(RentACarService rentACarService, CarAdminService carAdminService, VehicleService vehicleService, OfficeService officeService) { RentACarService = rentACarService; CarAdminService = carAdminService; VehicleService = vehicleService; OfficeService = officeService; }
private async void OnInitialize(object parameter) { GetEvent <InitDialogEvent>().Unsubscribe(OnInitialize); Contacts = null; _contactsCount = await OfficeService.GetContactsCount(); await GetFirstPage(); }
private async Task GetOfficeGridData() { OfficeGridLoading = true; StateHasChanged(); Offices = await OfficeService.GetOffices(); OfficeGridLoading = false; StateHasChanged(); }
public void GetOfficesTest() { var results = OfficeService.GetNearestOffices(new WijsOef.Data.Domain.OfficeQuery() { Latitude = 2, Longitude = 5, Radius = 20 }); Assert.IsTrue(results.Count == 2); }
public ActionResult Index() { OfficeService service = new OfficeService(); var list = service.GetAll(); OfficeModel model = new OfficeModel(); model.ListOffice = list; return(View(model)); }
private async Task SetContactPhoto(Contact contact) { var photoData = await OfficeService.GetContactPhoto(contact.Id); if (photoData != null) { contact.Photo = await GetImage(photoData); contact.NotifyPropertyChanged("Photo"); } }
public void ShouldReturnAnOfficeSync() { var officeJson = StubDataLoader.LoadJsonFile("office.json"); IOfficeService service = new OfficeService(new MoxiWorksClient(new StubContextClient(officeJson))); var response = service.GetOffice("some_moxiworks_office_id", "some_moxiworks_company_id"); Assert.IsType <Office>(response.Item); Assert.True(response.Item.CreatedTimestamp.HasValue); Assert.False(response.Item.DeactivatedTimestamp.HasValue); }
public ActionResult Edit(Office model) { try { OfficeService service = new OfficeService(); service.Update(model); return(RedirectToAction("Index", "Office")); } catch { return(View()); } }
public void ShouldReturnACollectionOfOfficesSync() { var officeJson = StubDataLoader.LoadJsonFile("Offices.json"); IOfficeService service = new OfficeService(new MoxiWorksClient(new StubContextClient(officeJson))); var response = service.GetCompanyOffices("some_moxiworks_company_id"); Assert.IsType <OfficeResults>(response.Item); Assert.True(response.Item.Offices.Count == 1); Assert.True(response.Item.Offices[0].CreatedTimestamp.HasValue); Assert.False(response.Item.Offices[0].DeactivatedTimestamp.HasValue); }
private void btnAdd_Click(object sender, EventArgs e) { OfficeService areaService = new OfficeService(new CoffeShopContext()); if (areaService.Insert(tbNameTable.Text)) { MessageBox.Show("Thêm Thành Công", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Dispose(); } else { MessageBox.Show("Thất Bại", "Thông Báo", MessageBoxButtons.OKCancel, MessageBoxIcon.Error); } }
public ActionResult Index() { OrderService service = new OrderService(); OfficeService offservice = new OfficeService(); var list = service.GetListOrder(); OrderModel model = new OrderModel(); model.Listorder = list; List <Office> lstoffname = offservice.GetOfficeName(); SelectList namelist = new SelectList(lstoffname, "", "OfficeName"); ViewBag.Listname = namelist; return(View(model)); }
public ActionResult Index(FilterModel model) { OrderService service = new OrderService(); OfficeService offservice = new OfficeService(); OrderModel order = new OrderModel(); var lstorder = service.GetFilter(model.Name, model.OfficeName, model.FromDate, model.ToDate); order.Listorder = lstorder; List <Office> lstoffname = offservice.GetOfficeName(); SelectList namelist = new SelectList(lstoffname, "", "OfficeName"); ViewBag.Listname = namelist; return(View(order)); }
private void btnSave_Click(object sender, EventArgs e) { object dataTable = gridControl1.DataSource; OfficeService officeService = new OfficeService(new CoffeShopContext()); if (officeService.Update(dataTable)) { MessageBox.Show("Lưu Thành Công", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Thất Bại", "Thông Báo", MessageBoxButtons.OKCancel, MessageBoxIcon.Error); } loadData(); }
public ActionResult Edit(int ID) { AccountService service = new AccountService(); OfficeService service1 = new OfficeService(); RolService role = new RolService(); var account = service.Getbykey(ID); List <Office> list = service1.GetAll().ToList(); SelectList officelist = new SelectList(list, "OfficeID", "OfficeName"); ViewBag.OfficeList = officelist; List <Rol> listrole = role.GetAll().ToList(); SelectList rolelist = new SelectList(listrole, "RoleID", "Role_Name"); ViewBag.RoleList = rolelist; return(View(account)); }
private async Task GetContacts() { using (new Loading(this)) { var items = await OfficeService.GetContacts(_curPageIndex, PageSize); Contacts = new ObservableCollection <Contact>(items); var tasks = Contacts.Select(x => SetContactPhoto(x)); await Task.WhenAll(tasks); } HasPrev = _curPageIndex > 0; HasNext = PageSize * (_curPageIndex + 1) < _contactsCount; IsLoading = false; }