public IActionResult GetAllCustomers() { CustomerListModel customer = epayco.CustomerGetList(); return(Ok(customer)); }
public async Task <IActionResult> ExportXmlAll(CustomerListModel model) { var customers = await _customerService.GetAllCustomers( customerRoleIds : model.SearchCustomerRoleIds.ToArray(), email : model.SearchEmail, username : model.SearchUsername, firstName : model.SearchFirstName, lastName : model.SearchLastName, company : model.SearchCompany, phone : model.SearchPhone, zipPostalCode : model.SearchZipPostalCode, loadOnlyWithShoppingCart : false); try { var xml = await _exportManager.ExportCustomersToXml(customers); return(File(Encoding.UTF8.GetBytes(xml), "application/xml", "customers.xml")); } catch (Exception exc) { ErrorNotification(exc); return(RedirectToAction("List")); } }
public virtual ActionResult List() { if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers)) { return(AccessDeniedView()); } var defaultRoleIds = new List <int> { _customerService.GetCustomerRoleBySystemName(SystemCustomerRoleNames.Registered).Id }; var model = new CustomerListModel { SearchCustomerRoleIds = defaultRoleIds, DateOfBirthEnabled = _customerSettings.DateOfBirthEnabled, CompanyEnabled = _customerSettings.CompanyEnabled, PhoneEnabled = _customerSettings.PhoneEnabled }; var allRoles = _customerService.GetAllCustomerRoles(true); foreach (var role in allRoles) { model.AvailableCustomerRoles.Add(new SelectListItem { Text = role.Name, Value = role.Id.ToString(), Selected = defaultRoleIds.Any(x => x == role.Id) }); } return(View(model)); }
public JsonResult List(CustomerListModel model) { int rowSize = 20; AjaxResult ajaxResult = null; var total = db.Customers.Count(); var customers = db.Customers.OrderBy(p => p.Name).Skip(model.page * rowSize).Take(rowSize).Select(p => new { Id = p.Id, Address = p.Address, Name = p.Name, Age = p.Birthday == null ? -1 : (DateTime.Now.Year - p.Birthday.Value.Year), Date = p.Birthday }).ToList(); ajaxResult = new AjaxResult() { Success = true, Msg = "加载数据成功", Body = new { Total = total, Customers = customers } }; return(new JsonResult() { ContentEncoding = Encoding.UTF8, Data = CommonJson.camelJson(ajaxResult), JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }
public ActionResult List() { var defaultRoleIds = new List <int> { _customerService.GetCustomerRoleBySystemName (SystemCustomerRoleNames.Registered).Id }; //var defaultRoleIds = new List<int> { 1, 2, 3 }; var model = new CustomerListModel { SearchCustomerRoleIds = defaultRoleIds }; var allRoles = _customerService.GetAllCustomerRoles(); foreach (var role in allRoles) { model.AvailableCustomerRoles.Add(new SelectListItem { Text = role.Name, Value = role.Id.ToString(), Selected = defaultRoleIds.Any(x => x == role.Id) }); } //for (int i = 0; i < 3; i++) //{ // model.AvailableCustomerRoles.Add(new SelectListItem // { // Text = "role" + i, // Value = i.ToString(), // Selected = false // }); //} return(View(model)); }
public ActionResult CustomerList(DataSourceRequest command, CustomerListModel model, int[] searchCustomerRoleIds) { var searchDayOfBirth = 0; int searchMonthOfBirth = 0; if (!String.IsNullOrWhiteSpace(model.SearchDayOfBirth)) { searchDayOfBirth = Convert.ToInt32(model.SearchDayOfBirth); } if (!String.IsNullOrWhiteSpace(model.SearchMonthOfBirth)) { searchMonthOfBirth = Convert.ToInt32(model.SearchMonthOfBirth); } var customers = _customerService.GetAllCustomers( customerRoleIds: searchCustomerRoleIds, email: model.SearchEmail, userName: model.SearchUserName, firstName: model.SearchFirstName, lastName: model.SearchLastName, dayOfBirth: searchDayOfBirth, monthOfBirth: searchMonthOfBirth, phone: model.SearchPhone, ipAddress: model.SearchIpAddress, pageIndex: command.Page - 1, pageSize: command.PageSize); var gridModel = new DataSourceResult { Data = customers.Select(PrepareCustomerModelForList), Total = customers.TotalCount }; return(Json(gridModel)); }
public ActionResult Direction(string territory = "", int page = 1) { var model = new CustomerListModel(); model.District = "DJKT001"; ICollection <QueryFilter> filters = new List <QueryFilter>(); filters.Add(new QueryFilter("district", model.District)); string customers = _customerAppService.Find(filters); //string customers = _customerAppService.GetAll(); model.Customers = string.IsNullOrEmpty(customers) ? new List <CustomerModel>() : JsonConvert.DeserializeObject <List <CustomerModel> >(customers); model.Customers = model.Customers.OrderBy(x => x.teritorry).ThenByDescending(x => x.geographical_y).ToList(); if (territory == "") { return(RedirectToAction("Direction", new { territory = model.Customers[0].teritorry, page = 1 })); } else { model.Territory = territory; var temp_cust = model.Customers.Where(x => x.teritorry == model.Territory).ToList(); return(View(model)); } }
public JsonResult CustomerList(int skip, int take, int page, int pageSize) { if (!this.permissionService.Authorize(StandardPermissionProvider.GetCustomerList)) { return(AccessDeniedJson()); } PagedResult <Customer> cutomers = this.customerService.GetCustomers(page, pageSize); if (cutomers != null) { List <CustomerListModel> customersList = new List <CustomerListModel>(); foreach (var customer in cutomers) { CustomerListModel model = Mapper.Map <Customer, CustomerListModel>(customer); model.Sex = customer.Male ? "男" : "女"; model.CreatedOn = customer.CreatedOn.ToShortDateString(); customersList.Add(model); } return(Json( new { total = cutomers.TotalRecords, data = customersList }, JsonRequestBehavior.AllowGet)); } return(Json(null)); }
protected void PrepareCustomerListModel(CustomerListModel model) { if (model == null) { throw new UserFriendlyException("model"); } }
public ActionResult Index(string ID = "") { var model = new CustomerListModel(); model.District = "DJKT001"; ICollection <QueryFilter> filters = new List <QueryFilter>(); filters.Add(new QueryFilter("district", model.District)); string customers = _customerAppService.Find(filters); //string customers = _customerAppService.GetAll(); model.Customers = string.IsNullOrEmpty(customers) ? new List <CustomerModel>() : JsonConvert.DeserializeObject <List <CustomerModel> >(customers); model.Customers = model.Customers.OrderBy(x => x.teritorry).ThenBy(x => x.order_number).ToList(); if (ID == "") { return(RedirectToAction("Index/" + model.Customers[0].teritorry)); } else { model.Territory = ID; var temp_cust = model.Customers.Where(x => x.teritorry == model.Territory).ToList(); if (temp_cust[(temp_cust.Count() - 1)].order_number == 0) { model.Customers = model.Customers.OrderBy(x => x.teritorry).ThenByDescending(x => x.geographical_y).ToList(); } return(View(model)); } }
public ActionResult List(DataSourceRequest command, CustomerListModel model) { CustomerRole?role = null; if (model.RoleId.HasValue) { role = (CustomerRole)model.RoleId; } var customer = _customerService.GetAllCustomers(keywords: model.Keywords, roleId: role, isSub: model.Sub, pageIndex: command.Page - 1, pageSize: command.PageSize); var jsonData = new DataSourceResult { Data = customer.Items.Select(c => new { Id = c.Id, Name = c.NickName, Mobile = c.Mobile, CreationTime = c.CreationTime, IsSubscribe = c.IsSubscribe, CustomerRole = ((CustomerRole)c.CustomerRoleId).GetDescription(), WidthOrder = _orderService.GetAllOrders(customerId: c.Id).TotalCount, Promoter = GetPromoter(c.Promoter) }).ToList(), Total = customer.TotalCount }; return(AbpJson(jsonData)); }
/// <summary> /// Binds the customer model. /// </summary> /// <param name="customerListModel">The customer list model.</param> /// <returns></returns> public static AddCustomerModel BindAddCustomerModel(CustomerListModel customerListModel) { AddCustomerModel addCustomerModel = new AddCustomerModel(); if (customerListModel.CompanyEmailId.IsNotNullOrEmpty()) { addCustomerModel.CompanyEmailId = DBHelper.ParseString(customerListModel.CompanyEmailId); } if (customerListModel.CompanyMobile.IsNotNullOrEmpty()) { addCustomerModel.CompanyMobile = DBHelper.ParseString(customerListModel.CompanyMobile); } if (customerListModel.CompanyName.IsNotNullOrEmpty()) { addCustomerModel.CompanyName = DBHelper.ParseString(customerListModel.CompanyName); } if (customerListModel.CustomerId.IsGreaterThenZero()) { addCustomerModel.CustomerId = DBHelper.ParseInt64(customerListModel.CustomerId); } addCustomerModel.EmailId = DBHelper.ParseString(customerListModel.EmailId); addCustomerModel.Mobile = DBHelper.ParseString(customerListModel.Mobile); addCustomerModel.Password = DBHelper.ParseString(customerListModel.Password); addCustomerModel.Name = DBHelper.ParseString(customerListModel.Name); return(addCustomerModel); }
public ActionResult Index() { var customers = CustomerService.GetCustomers(); var model = new CustomerListModel(customers); return(View(model)); }
public ActionResult BoxCustomerList() { var model = new CustomerListModel(); PrepareCustomerListModel(model); return(View(model)); }
public virtual ActionResult Customer() { var model = new CustomerListModel(); model.Active = _comm.GetActiveList(); model.Fields = GetFields(); return(View(model)); }
public ActionResult Index(string message = "") { ViewBag.ErrorMessage = message; CustomerListModel model = new CustomerListModel(); model.Customers = CustomerHelper.GetCustomers(); return(View(model)); }
/// <summary> /// 首页 /// </summary> /// <returns></returns> public ActionResult Index() { var model = new CustomerListModel(); model.CustomerChannels = GetCustomerChannels(); model.CustomerTypes = GetCustomerTypes(); return(View("~/Views/Customer/index.cshtml", model)); }
public CustomerListModel PrepareCustomerListBlogModel() { var model = new CustomerListModel { CustomerBlogList = PrepareCustomerBlogModelList() }; return(model); }
public IActionResult Index() { CustomerListModel customerModel = new CustomerListModel { CustomerList = ICustomerService.CustomerList().ToList() }; return(View(customerModel)); //GELEN LİSTEYİ MODELE ATIP VİEW'A YOLLA }
/// <summary> /// 根据条件获取用户详情 /// </summary> /// <param name="model">The model.</param> /// <param name="command">The command.</param> /// <returns></returns> public ActionResult ListCustomer(CustomerListModel model, CustomerListPagingFilteringModel command) { if (command.PageNumber <= 0) { command.PageNumber = 1; } if (null == model) { model = new CustomerListModel(); } var roles = _customerService.GetAllCustomerRoles(); model.AvailableRoles = roles.ToSelectItems(); model.AvailableRoles.Insert(0, new SelectListItem() { Text = "请选择", Value = "0" }); model.AvailableActive = new List <SelectListItem>() { new SelectListItem() { Text = "请选择", Value = "0", Selected = true }, new SelectListItem() { Text = "激活", Value = "1" }, new SelectListItem() { Text = "停用", Value = "2" } }; bool?active = null; if (model.ActiveId == 1) { active = true; } else if (model.ActiveId == 2) { active = false; } var list = _customerService.GetAllCustormers(model.UserName, model.CustomerRoleId, active, model.BeginDate, model.EndDate, pageIndex: command.PageNumber - 1, pageSize: command.PageSize); model.Customers = list; model.PagingFilteringContext.LoadPagedList(list); return(View(model)); }
public virtual ActionResult List() { if (!_permissionService.Authorize(StandardPermissionProvider.ManageUser)) { return(AccessDeniedView()); } var model = new CustomerListModel(); return(View(model)); }
public ActionResult Delete(int index, int id) { var model = new CustomerListModel(); model.GridIndex = index; try { CustomerService.DeleteCustomer(CurrentCompany.Id, id); } catch (Exception e1) { model.Error.SetError(e1); } return(Json(model, JsonRequestBehavior.AllowGet)); }
public IActionResult CustomerList(DataSourceRequest command, CustomerListModel model, string[] searchCustomerRoleIds, string[] searchCustomerTagIds) { var customers = _customerViewModelService.PrepareCustomerList(model, searchCustomerRoleIds, searchCustomerTagIds, command.Page, command.PageSize); var gridModel = new DataSourceResult { Data = customers.customerModelList.ToList(), Total = customers.totalCount }; return(Json(gridModel)); }
public ActionResult List(int page = 1) { var viewModel = new CustomerListModel(); //var customers = UserManager.GetAllUsers(page,"","",""); //var customerVms = customers.Select(PrepareCustomerViewModelForList); //var pagedList = new PagedList<CustomerViewModel>(customerVms, page, _pagedSize, customers.TotalItems); //viewModel.Customers = pagedList; return(View(viewModel)); }
public ViewResult List(CustomerListRequest request) { var customerPagedList = customerService.GetCustomerList(request); var viewModel = new CustomerListModel { Name = request.Name, Sex = request.Sex, UserNo = request.UserNo, CustomerList = customerPagedList }; return(View(viewModel)); }
}//..End ActiveCustomerList public int RemoveCustomer(CustomerListModel model) { using (SqlConnection conn = new SqlConnection(DBCon)) { conn.Open(); SqlCommand cmd = new SqlCommand("RemoveCustomer", conn);//call Stored Procedure cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@CustID", model.CustomerId); int rs = cmd.ExecuteNonQuery(); return(rs); } }
public IActionResult Get() { try { var items = new CustomerListModel(); items.Customers = _customerService.GetAll(); return(StatusCode(StatusCodes.Status200OK, items.Customers.ToList())); } catch (Exception ex) { return(StatusCode(StatusCodes.Status204NoContent, ex)); } }
// GET: ClaimList public async Task <ActionResult> Index() { ClaimTeamLoginModel client = (ClaimTeamLoginModel)Session[SessionHelper.claimTeamLogin]; string UserId = client.UserId; List <CustomerModel> list = new List <CustomerModel>(); CustomerListModel CustomerList = new CustomerListModel(); ClaimListRepo protalLoginAccountsRepo = new ClaimListRepo(); list = await protalLoginAccountsRepo.GetCustomerList(UserId); CustomerList.CustomerList = list; return(View(CustomerList)); }
// GET: User public IActionResult Index() { if (!(bool)SharedData.isManageUserMenuAccessible) { return(AccessDeniedView()); } //PageSize //var report = SharedData.CustomerReport; //if (report != null) //{ // SharedData.RowCount = report.RowCount; // SharedData.ReportName = "Customer"; //} //else //{ // SharedData.RowCount = 10; // SharedData.ReportName = "Customer"; //} //FormName ViewBag.FormName = "Users"; //permissions if (SharedData.isManageUserMenuAccessible == false) { return(AccessDeniedView()); } CustomerListModel customerListModel = new CustomerListModel(); var cust = _customerService.GetAllCustomers(); foreach (var item in cust) { customerListModel.ListCustomerModel.Add(new CustomerViewModel { CustomerName = _encryptionService.DecryptText(item.BillingAddress.FirstName) + " " + _encryptionService.DecryptText(item.BillingAddress.LastName), Id = item.Id, Email = _encryptionService.DecryptText(item.Email), Status = item.Active, CustomerRoleName = _customerService.GetCustomerRoleById(item.CustomerRoleId).Name // CustomerName = _encryptionService.DecryptText(item.BillingAddress.FirstName) + " " // + _encryptionService.DecryptText(item.BillingAddress.LastName), //Id = item.Id, //Email = _encryptionService.DecryptText(item.Email), //Status = item.Active, //CustomerRoleName = _customerService.GetCustomerRoleById(item.CustomerRoleId).Name }); } return(View(customerListModel)); }
public CustomerListControl(CustomerListModel model) { InitializeComponent(); _presenter = new CustomerListPresenter(this, model); gvCustomer.PopupMenuShowing += gvCustomer_PopupMenuShowing; gvCustomer.FocusedRowChanged += gvCustomer_FocusedRowChanged; // init editor control accessibility btnNewCustomer.Enabled = AllowInsert; cmsEditData.Enabled = AllowEdit; cmsDeleteData.Enabled = AllowDelete; this.Load += CustomerListControl_Load; }