Exemplo n.º 1
0
 void detail_AddingOrderDetail(object sender, CreateOrderDetailModel e)
 {
     Details.Source.Add(e);
     CalculatingTotalPayment();
     CalculatingTotalPaymentByDiscount();
     NotifyDetailHeader();
 }
Exemplo n.º 2
0
        private void OnUpdateDetail(object arg)
        {
            if (UpdatingOrderDetail != null)
            {
                UpdatingOrderDetail(this, this);
            }

            Task.Run(() => {
                IDbManager dbManager = ObjectPool.Instance.Resolve <IDbManager>();
                IDataCommand db      = dbManager.GetDatabase(ApplicationSettings.Instance.Database.DefaultConnection.Name);

                CreateOrderDetailModel detail = (CreateOrderDetailModel)arg;
                db.Execute("UpdateOrderDetail", new
                {
                    MaterialTypeId = detail.SelectedMaterial.Id,
                    QualityId      = detail.SelectedQuality.Id,
                    FinishingId    = detail.SelectedFinishing.Id,
                    Title          = detail.title,
                    Width          = detail.width,
                    Height         = detail.height,
                    Qty            = detail.qty,
                    Queue          = detail.Queue,
                    Deadline       = detail.deadline,
                    Description    = detail.description,
                    Total          = detail.Price,
                    OrderId        = detail.orderId,
                    SeqNbr         = detail.SeqNbr
                });

                db.Close();
            });
        }
Exemplo n.º 3
0
        private void OnAddDetail()
        {
            IDialogService         dialog = ObjectPool.Instance.Resolve <IDialogService>();
            CreateOrderDetailModel detail = new CreateOrderDetailModel();

            detail.AddingOrderDetail += detail_AddingOrderDetail;
            bool?dialogResult = dialog.ShowDialog <CreateOrderDetail>(detail);

            detail.AddingOrderDetail -= detail_AddingOrderDetail;
        }
Exemplo n.º 4
0
        private async Task <CreateOrderDetailModel> BeginCloneAsync()
        {
            CreateOrderDetailModel detail = new CreateOrderDetailModel();

            await Task.Run(() =>
            {
                if ((this.SelectedFinishing == null) || (this.SelectedMaterial == null) || (this.selectedQuality == null))
                {
                    return;
                }

                detail.title = this.title;

                detail.SelectedFinishing             = new KeyValueOption();
                detail.SelectedFinishing.Id          = this.SelectedFinishing.Id;
                detail.SelectedFinishing.Description = this.SelectedFinishing.Description;

                //detail.SelectedMaterial = new MaterialType();
                //detail.SelectedMaterial.Id = this.SelectedMaterial.Id;
                //detail.SelectedMaterial.Description = this.SelectedMaterial.Description;
                //detail.SelectedMaterial.QualityId = this.SelectedMaterial.QualityId;
                //detail.SelectedMaterial.Price = this.SelectedMaterial.Price;

                //detail.SelectedQuality = new KeyValueOption();
                //detail.SelectedQuality.Id = this.SelectedQuality.Id;
                //detail.SelectedQuality.Description = this.SelectedQuality.Description;

                detail.SelectedMaterial = this.selectedMaterial;

                detail.SelectedQuality = this.selectedQuality;

                detail.QualityId   = this.QualityId;
                detail.MaterialId  = this.MaterialId;
                detail.FinishingId = this.FinishingId;
                detail.CreatedDate = this.CreatedDate;

                detail.Width          = this.width;
                detail.Height         = this.height;
                detail.Qty            = this.qty;
                detail.Price          = this.price;
                detail.Stream         = this.stream;
                detail.Filename       = this.filename;
                detail.ThumbnailImage = this.thumbnailImage;
                detail.Description    = this.description;
                detail.Deadline       = this.deadline;
                detail.Queue          = this.queue;
            });

            return(detail);
        }
Exemplo n.º 5
0
        private void OnEditDetail(object obj)
        {
            if (obj == null)
            {
                return;
            }

            if (((CreateOrderDetailModel)obj).Status == "F")
            {
                return;
            }

            CreateOrderDetailModel model = (CreateOrderDetailModel)obj;

            model.IsReadOnly = true;

            IDialogService dialog = ObjectPool.Instance.Resolve <IDialogService>();

            model.UpdatingOrderDetail += detail_UpdatingOrderDetail;
            dialog.ShowDialog <CreateOrderDetail>(model);
            model.UpdatingOrderDetail -= detail_UpdatingOrderDetail;
        }
Exemplo n.º 6
0
 void detail_UpdatingOrderDetail(object sender, CreateOrderDetailModel e)
 {
     CalculatingTotalPayment();
     CalculatingTotalPaymentByDiscount();
     NotifyDetailHeader();
 }
Exemplo n.º 7
0
        private void OnAddDetail()
        {
            IDialogService dialog = ObjectPool.Instance.Resolve<IDialogService>();
            CreateOrderDetailModel detail = new CreateOrderDetailModel();

            detail.AddingOrderDetail += detail_AddingOrderDetail;
            bool? dialogResult = dialog.ShowDialog<CreateOrderDetail>(detail);
            detail.AddingOrderDetail -= detail_AddingOrderDetail; 
        }
Exemplo n.º 8
0
 void detail_UpdatingOrderDetail(object sender, CreateOrderDetailModel e)
 {
     CalculatingTotalPayment();
     CalculatingTotalPaymentByDiscount();
     NotifyDetailHeader();
 }
Exemplo n.º 9
0
 void detail_AddingOrderDetail(object sender, CreateOrderDetailModel e)
 {
     Details.Source.Add(e);
     CalculatingTotalPayment();
     CalculatingTotalPaymentByDiscount();
     NotifyDetailHeader();
 }
Exemplo n.º 10
0
        private async Task<CreateOrderDetailModel> BeginCloneAsync()
        {
            CreateOrderDetailModel detail = new CreateOrderDetailModel();
             
            await Task.Run(() =>
            {
                if ((this.SelectedFinishing == null) || (this.SelectedMaterial == null) || (this.selectedQuality == null))
                    return;

                detail.title = this.title;
               
                detail.SelectedFinishing = new KeyValueOption(); 
                detail.SelectedFinishing.Id = this.SelectedFinishing.Id;
                detail.SelectedFinishing.Description = this.SelectedFinishing.Description;

                //detail.SelectedMaterial = new MaterialType();
                //detail.SelectedMaterial.Id = this.SelectedMaterial.Id;
                //detail.SelectedMaterial.Description = this.SelectedMaterial.Description;
                //detail.SelectedMaterial.QualityId = this.SelectedMaterial.QualityId;
                //detail.SelectedMaterial.Price = this.SelectedMaterial.Price;

                //detail.SelectedQuality = new KeyValueOption();
                //detail.SelectedQuality.Id = this.SelectedQuality.Id;
                //detail.SelectedQuality.Description = this.SelectedQuality.Description;

                detail.SelectedMaterial = this.selectedMaterial;

                detail.SelectedQuality = this.selectedQuality;
                 
                detail.QualityId = this.QualityId;
                detail.MaterialId = this.MaterialId;
                detail.FinishingId = this.FinishingId;
                detail.CreatedDate = this.CreatedDate;

                detail.Width = this.width;
                detail.Height = this.height;
                detail.Qty = this.qty;
                detail.Price = this.price;
                detail.Stream = this.stream;
                detail.Filename = this.filename;
                detail.ThumbnailImage = this.thumbnailImage;
                detail.Description = this.description;
                detail.Deadline = this.deadline;
                detail.Queue = this.queue;

            });

            return detail;
        }