Ejemplo n.º 1
0
        public override void OnDelete(object obj)
        {
            WarningModel message = new WarningModel()
            {
                Message = "Are you sure want to delete data?"
            };

            IDialogService dialog = ObjectPool.Instance.Resolve <IDialogService>();
            bool?          result = dialog.ShowDialog <YesNo>(message);

            if (result.HasValue && result.Value)
            {
                IDbManager        dbManager         = ObjectPool.Instance.Resolve <IDbManager>();
                IDataCommand      db                = dbManager.GetDatabase(ApplicationSettings.Instance.Database.DefaultConnection.Name);
                OrderCollaborator orderCollaborator = ObjectPool.Instance.Resolve <OrderCollaborator>();
                foreach (CreateOrderModel order in Source.ToList())
                {
                    if (order.IsSelected)
                    {
                        db.Execute("DeletePrintOrder", new
                        {
                            OrderId = order.PoNumber,
                            Status  = "F"
                        });
                        orderCollaborator.PaymentOrder.source.Remove(order);
                    }
                }
                db.Close();
                base.OnDelete(obj);
            }
        }
Ejemplo n.º 2
0
        private void OnAddDetail(object arg)
        {
            if (!Verify())
            {
                WarningModel warning = new WarningModel()
                {
                    Message = "Please make sure all item is filled"
                };
                IDialogService dialog = ObjectPool.Instance.Resolve <IDialogService>();
                dialog.ShowDialog <Warning>(warning);
            }
            else
            {
                Task.Factory.StartNew(() =>
                {
                    IsBusy = true;
                    if (AddingOrderDetail != null)
                    {
                        AddingOrderDetail(this, (CreateOrderDetailModel)this.Clone());
                    }

                    InitializeModel();
                    IsBusy = false;
                });
            }
        }
Ejemplo n.º 3
0
        private void OnAddDetail(object arg)
        {
            if (!Verify())
            {
                WarningModel warning = new WarningModel()
                {
                    Message = "Please make sure all item is filled"
                };
                IDialogService dialog = ObjectPool.Instance.Resolve<IDialogService>();
                dialog.ShowDialog<Warning>(warning); 
            }
            else
            { 
                Task.Factory.StartNew(() =>
                {
                    IsBusy = true;
                    if (AddingOrderDetail != null)
                        AddingOrderDetail(this, (CreateOrderDetailModel)this.Clone());

                    InitializeModel();
                    IsBusy = false;
                });
            } 
        }