private void ButtonNew_Click(object sender, RoutedEventArgs e) { var processOrderColorDetailList = new List <ProcessOrderColorDetail>(); var selectedItem = ComboBoxStatus.SelectedItem.ToString(); ProcessOrderColorStatus status = new ProcessOrderColorStatus(); Enum.TryParse <ProcessOrderColorStatus>(selectedItem, out status); processOrderColorDetailList.Add(new ProcessOrderColorDetail { OrderNo = _processOrder.OrderNo, Color = TextBoxColor.Text, ColorNumber = TextBoxColorNumber.Text, Quantity = TextBoxQuantity.Text.ToInt(), Status = status } ); ProcessModule.CreateProcessOrderColorFlow(processOrderColorDetailList, _processOrder.OrderNo); ProcessOrderPage page = (ProcessOrderPage)this.DataContext; page.UpdateDataGridOrderColorFactoryShippingDetail(_processOrder.OrderNo); this.Close(); }
public IEnumerable <ProcessOrder> GetProcessOrderByStatus(ProcessOrderColorStatus status) { IEnumerable <ProcessOrder> result; if (status == 0) { result = ProcessOrderAdapter.GetProcessOrder(); } else if (status == ProcessOrderColorStatus.未完成) { result = ProcessOrderAdapter.GetProcessOrderByStatus(new List <ProcessOrderColorStatus> { ProcessOrderColorStatus.未完成, ProcessOrderColorStatus.緊急 }).OrderByDescending(o => o.OrderNo); } else { result = ProcessOrderAdapter.GetProcessOrderByStatus(new List <ProcessOrderColorStatus> { status }).OrderByDescending(o => o.OrderNo); } return(result); }
public int UpdateProcessOrderFlowDate(int orderColorDetailNo, ProcessOrderColorStatus status) { var sqlCmd = @"UPDATE ProcessOrderColorDetail SET Status = @Status, UpdateDate = GETDATE() WHERE OrderColorDetailNo = @OrderColorDetailNo"; SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@OrderColorDetailNo", SqlDbType.Int) { Value = orderColorDetailNo }, new SqlParameter("@Status", SqlDbType.Int) { Value = status } }; var count = DapperHelper.ExecuteParameter(AppSettingConfig.ConnectionString(), CommandType.Text, sqlCmd, parameters); return(count); }
/// <summary> /// 更新加工訂單顏色狀態 /// </summary> /// <param name="orderColorDetailNo"></param> /// <param name="status"></param> /// <returns></returns> public int UpdateProcessOrderColorStatus(int orderColorDetailNo, ProcessOrderColorStatus status) { int result = ProcessOrderAdapter.UpdateProcessOrderFlowDate(orderColorDetailNo, status); return(result); }