コード例 #1
0
        private void Button_Save_Click(object sender, RoutedEventArgs e)
        {
            if (!ValidationHelper.Validation(this.tbKeyWord, ValidationForAmount))
            {
                return;
            }
            OrderCheckItemVM model = this.DataContext as OrderCheckItemVM;

            model.Description = string.Empty;
            model.Status      = OrderCheckStatus.Valid;
            OrderCheckItemFacade facade = new OrderCheckItemFacade();

            facade.CreateOrderCheckItem(model, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                else
                {
                    if (Dialog != null)
                    {
                        Dialog.ResultArgs.Data         = args;
                        Dialog.ResultArgs.DialogResult = DialogResultType.OK;
                        Dialog.Close();
                    }
                }
            });
        }
コード例 #2
0
        private void Button_Save_Click(object sender, RoutedEventArgs e)
        {
            if (!ValidationHelper.Validation(this.Combox_Status, ValidationForStatus))
            {
                return;
            }
            if (rbtnProductType.IsChecked.Value)
            {
                if (orderCheckItemVM.Category3No == null)
                {
                    CPApplication.Current.CurrentPage.Context.Window.Alert(ResOrderCheck.msg_ValidateCategory);
                    return;
                }
            }
            else
            {
                if (string.IsNullOrEmpty(orderCheckItemVM.ProductID))
                {
                    CPApplication.Current.CurrentPage.Context.Window.Alert(ResOrderCheck.msg_ValidateProduct);
                    return;
                }
            }
            OrderCheckItemFacade facade = new OrderCheckItemFacade();
            OrderCheckItemVM     model  = this.DataContext as OrderCheckItemVM;

            if (model.IsProductType)
            {
                model.ReferenceType = "PC3";
            }
            else if (model.IsProductSysNo)
            {
                model.ReferenceType = "PID";
            }
            model.Description      = model.Category3No.HasValue ? model.Category3No.ToString() : string.Empty;
            model.ReferenceContent = model.ProductID;
            facade.CreateOrderCheckItem(model, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                Dialog.ResultArgs.DialogResult = DialogResultType.OK;
                Dialog.Close();
            });
        }
コード例 #3
0
        private void Button_Save_Click(object sender, RoutedEventArgs e)
        {
            if (!Validate())
            {
                return;
            }
            OrderCheckItemVM model = this.DataContext as OrderCheckItemVM;

            model.ReferenceType = "SA";
            model.Status        = OrderCheckStatus.Valid;
            if (dpBegin.SelectedDateTime.HasValue)
            {
                model.ReferenceContent = dpBegin.SelectedDateTime.Value.ToString(ResConverter.DateTime_LongFormat);
            }
            if (dpEnd.SelectedDateTime.HasValue)
            {
                model.Description = dpEnd.SelectedDateTime.Value.ToString(ResConverter.DateTime_LongFormat);
            }
            OrderCheckItemFacade facade = new OrderCheckItemFacade();

            facade.CreateOrderCheckItem(model, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                else
                {
                    if (Dialog != null)
                    {
                        Dialog.ResultArgs.Data         = args;
                        Dialog.ResultArgs.DialogResult = DialogResultType.OK;
                        Dialog.Close();
                    }
                }
            });
        }
コード例 #4
0
        private void Button_Save_Click(object sender, RoutedEventArgs e)
        {
            if (!Validate())
            {
                return;
            }
            OrderCheckItemFacade facade = new OrderCheckItemFacade();

            OrderCheckItemVM model = this.DataContext as OrderCheckItemVM;

            if (model.ReferenceType == "DT11")
            {
                model.Description = model.ServiceTime_First.Value.ToString("HH:mm");
            }
            else
            {
                if (model.ServiceTime_Second.Value.TimeOfDay <= model.ServiceTime_First.Value.TimeOfDay)
                {
                    CPApplication.Current.CurrentPage.Context.Window.Alert("请保证时间点一小于时间点二!");
                    return;
                }
                model.Description = model.ServiceTime_First.Value.ToString("HH:mm") + "," + model.ServiceTime_Second.Value.ToString("HH:mm");
            }
            if (model.SysNo.HasValue) //编辑
            {
                facade.UpdateOrderCheckItem(model, (obj, args) =>
                {
                    if (args.FaultsHandle())
                    {
                        return;
                    }
                    else
                    {
                        if (Dialog != null)
                        {
                            Dialog.ResultArgs.Data         = args;
                            Dialog.ResultArgs.DialogResult = DialogResultType.OK;
                            Dialog.Close();
                        }
                    }
                });
            }
            else
            {
                model.Status = OrderCheckStatus.Valid;
                facade.CreateOrderCheckItem(model, (obj, args) =>
                {
                    if (args.FaultsHandle())
                    {
                        return;
                    }
                    else
                    {
                        if (Dialog != null)
                        {
                            Dialog.ResultArgs.Data         = args;
                            Dialog.ResultArgs.DialogResult = DialogResultType.OK;
                            Dialog.Close();
                        }
                    }
                });
            }
        }