コード例 #1
0
        public ActionResult Add(long?id)
        {
            var service = _iCustomerService;

            Entities.CustomerServiceInfo customerServiceInfo;
            if (id.HasValue && id > 0)
            {
                customerServiceInfo = service.GetCustomerService(CurrentSellerManager.ShopId, id.Value);
            }
            else
            {
                customerServiceInfo = new Entities.CustomerServiceInfo();
            }

            var customerServiceModels = new CustomerServiceModel()
            {
                Id      = customerServiceInfo.Id,
                Account = customerServiceInfo.AccountCode,
                Name    = customerServiceInfo.Name,
                Tool    = customerServiceInfo.Tool,
                Type    = customerServiceInfo.Type
            };

            return(View(customerServiceModels));
        }
コード例 #2
0
        public JsonResult Add(CustomerServiceModel customerServiceModel)
        {
            var service = _iCustomerService;

            Entities.CustomerServiceInfo customerServiceInfo = new Entities.CustomerServiceInfo()
            {
                Id           = customerServiceModel.Id,
                Type         = customerServiceModel.Type.GetValueOrDefault(Entities.CustomerServiceInfo.ServiceType.PreSale),
                Tool         = customerServiceModel.Tool,
                Name         = customerServiceModel.Name,
                AccountCode  = customerServiceModel.Account,
                ShopId       = CurrentSellerManager.ShopId,
                TerminalType = Mall.Entities.CustomerServiceInfo.ServiceTerminalType.PC,
                ServerStatus = Mall.Entities.CustomerServiceInfo.ServiceStatusType.Open
            };

            if (customerServiceInfo.Id > 0)
            {
                service.UpdateCustomerService(customerServiceInfo);
            }
            else
            {
                service.AddCustomerService(customerServiceInfo);
            }

            return(Json(new { success = true }));
        }
コード例 #3
0
        public ActionResult addMobile()
        {
            var service = _iCustomerService;

            Entities.CustomerServiceInfo customerServiceInfo;
            customerServiceInfo = service.GetCustomerServiceForMobile(CurrentSellerManager.ShopId);
            if (customerServiceInfo == null)
            {
                customerServiceInfo = new Entities.CustomerServiceInfo();
            }
            var customerServiceModels = new CustomerServiceModel()
            {
                Id      = customerServiceInfo.Id,
                Account = customerServiceInfo.AccountCode,
                Name    = customerServiceInfo.Name,
                Tool    = customerServiceInfo.Tool,
                Type    = customerServiceInfo.Type
            };

            return(View(customerServiceModels));
        }