public ManagerMenu(SavvyRepo repo) { this.repo = repo; this.locationtask = new LocationTask(repo); this.inventorytask = new InventoryTask(repo); this.producttask = new ProductTask(repo); this.ordertask = new OrderTask(repo); this.orderitemtask = new OrderItemTask(repo); }
public OrderHistoryMenu(SavvyContext context, DBMapper mapper) { this.repo = new SavvyRepo(context, mapper); this.locationtask = new LocationTask(repo); this.inventorytask = new InventoryTask(repo); this.producttask = new ProductTask(repo); this.ordertask = new OrderTask(repo); this.orderitemtask = new OrderItemTask(repo); this.customertask = new CustomerTask(repo); }
private async Task <TaskResult> ProcessTaskActionAsync(OrderTask task) { OnDisplayMessage($"[Order:{task.OrderId}, {TaskName} TaskId:{task.OrderTaskId}]: Start Processing"); await TaskRepository.InsertOrderActionLogAsync(new OrderActionLog { OrderId = task.OrderId, OrderTaskId = task.OrderTaskId, Comment = "Start Processing", CreatedTime = DateTime.Now, CreatedBy = LogUserName }); await TaskRepository.UpdateTaskStatusAsync(task.OrderTaskId, SmsTaskStatus.Processing.ToString(), LogUserName); TaskResult lastActionResult = new TaskResult { ResultStatus = SmsTaskStatus.Success }; foreach (var action in Actions) { if (CancellationToken.IsCancellationRequested) { OnDisplayMessage($"{TaskName}[{action.TaskActionName}] Cancelled"); lastActionResult.ResultStatus = SmsTaskStatus.TaskCancelled; break; } lastActionResult = await action.ProcessAsync(task.OrderTaskId); if (lastActionResult.ResultStatus != SmsTaskStatus.Success && lastActionResult.ResultStatus != SmsTaskStatus.CouldRunNext) { lastActionResult.Message = lastActionResult.Message; break; } } OnDisplayMessage($"[Order:{task.OrderId}, {TaskName} TaskId:{task.OrderTaskId}]:{lastActionResult.ResultStatus}"); await TaskRepository.InsertOrderActionLogAsync(new OrderActionLog { OrderId = task.OrderId, OrderTaskId = task.OrderTaskId, Comment = lastActionResult.ResultStatus.ToString(), Details = lastActionResult.Message, CreatedTime = DateTime.Now, CreatedBy = LogUserName }); await TaskRepository.UpdateTaskStatusAsync(task.OrderTaskId, lastActionResult.ResultStatus.ToString(), LogUserName); return(lastActionResult); }
public CartMenu() { SavvyContext context = new SavvyContext(); DBMapper mapper = new DBMapper(); this.repo = new SavvyRepo(context, mapper); this.locationtask = new LocationTask(repo); this.inventorytask = new InventoryTask(repo); this.producttask = new ProductTask(repo); this.carttask = new CartTask(repo); this.cartitemtask = new CartItemTask(repo); this.ordertask = new OrderTask(repo); this.orderitemtask = new OrderItemTask(repo); }
public void start() { OrderTask ordertask = new OrderTask(repo); Customer customer = customertask.GetCustomer(1); Console.WriteLine("How would you like to search for your order history?"); Console.WriteLine("[1] By Order Date (Ascending)"); Console.WriteLine("[2] By Order Date (Descending)"); Console.WriteLine("[3] By Price (Ascending)"); Console.WriteLine("[4] By Price (Descending)"); Console.WriteLine("[5] Go Back"); userInput = Console.ReadLine(); do { switch (userInput) { case "1": ordertask.GetOrderFirst(DateTime.Now); break; case "2": ordertask.GetOrderLast(DateTime.Now); break; case "3": ordertask.GetOrderCheap(customer); break; case "4": ordertask.GetOrderExpensive(customer); break; } }while (!userInput.Equals("5")); }
private void GetBuyCarModel(string TaskID) { if (!string.IsNullOrEmpty(TaskID)) { OrderTask OrderTask = BLL.OrderTask.Instance.GetOrderTask(Convert.ToInt32(TaskID)); if (OrderTask != null) { CreateTime = Convert.ToDateTime(OrderTask.CreateTime.ToString()).ToString("yyyy-MM-dd HH:mm:ss"); } Entities.OrderBuyCarInfo BuyCarModel = BLL.OrderBuyCarInfo.Instance.GetOrderBuyCarInfo(Convert.ToInt32(TaskID)); if (BuyCarModel != null) { //年龄 if (BuyCarModel.Age > 0) { this.lblAge.Text = BuyCarModel.Age.ToString(); } //身份证号码 this.lblIDCard.Text = BuyCarModel.IDCard; //婚姻状态 if (BuyCarModel.Marriage != -2) { if (BuyCarModel.Marriage.ToString() == "1") { this.lblMarriage.Text = "已婚"; } else { this.lblMarriage.Text = "未婚"; } } //车型名称 //this.lblCarName.Text = BuyCarModel.CarName; //认证车主 if (BuyCarModel.IsAttestation >= 0) { if (BuyCarModel.IsAttestation == 1) { this.lbllegalize.Text = "是"; } else if (BuyCarModel.IsAttestation == 0) { this.lbllegalize.Text = "否"; } } //驾龄 if (BuyCarModel.DriveAge > 0) { this.lblDriveAge.Text = BuyCarModel.DriveAge.ToString(); } //用户名 this.lblUserName.Text = BuyCarModel.UserName.ToString(); //车牌号 this.lblCarNumber.Text = BuyCarModel.CarNo.ToString(); //备注 this.lblNote.Text = BuyCarModel.Remark; //职业 if (BuyCarModel.Vocation >= 0) { this.lblVocation.Text = BLL.Util.GetEnumOptText(typeof(CustVocation), Convert.ToInt32(BuyCarModel.Vocation)); } //收入 if (BuyCarModel.Income >= 0) { this.lblInCome.Text = BLL.Util.GetEnumOptText(typeof(CustInCome), Convert.ToInt32(BuyCarModel.Income)); } UpdateTime = Convert.ToDateTime(BuyCarModel.LastModifyTime.ToString()).ToString("yyyy-MM-dd HH:mm:ss"); UpdateUser = BitAuto.YanFa.SysRightManager.Common.UserInfo.GerTrueName(Convert.ToInt32(BuyCarModel.CreateUserID)); string carType = BLL.CarTypeAPI.Instance.GetCarTypeNameByCarTypeID(int.Parse(BuyCarModel.CarTypeID.ToString())); string carMaster = BLL.CarTypeAPI.Instance.GetMasterBrandNameByMasterBrandID(int.Parse(BuyCarModel.CarBrandId.ToString())); string carSerial = BLL.CarTypeAPI.Instance.GetSerialNameBySerialID(int.Parse(BuyCarModel.CarSerialId.ToString())); if (!string.IsNullOrEmpty(carMaster)) { lblCarName.Text += carMaster; } if (!string.IsNullOrEmpty(carSerial)) { lblCarName.Text += "-" + carSerial; } if (!string.IsNullOrEmpty(carType)) { lblCarName.Text += "-" + carType; } } } }