Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        /// <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);
        }