public void SetOrder(Order order)
        {
            if (ViewModel != null && ViewModel.Order == order)
                return;

            ViewModel = new OrderInformationViewModel(order);
        }
 public void SetOrder(Order order)
 {
     this.NewEnquiryViewModel = new NewEnquiryViewModel(order);
     if (!IsNewEnquiry)
     {
         this.NewEnquiryViewModel.IsReadOnly = true;
     }
 }
 public void SetOrder(Order order)
 {
     if (ViewModel == null || ViewModel.Order != order)
     {
         this.Order = order;
         ViewModel = new CreateNewPurchaseOrderViewModel(order);
     }
     SetUIAccesibility(PurchaseOrderState.New);
 }
 public bool SetOrder(Order order)
 {
     if (m_Order != order)
     {
         if (order != null)
         {
             HistoryItems = new ObservableCollection<History>(order.Histories.Reverse());
             //CreateDummyData();
         }
         m_Order = order;
     }
     return true;
 }       
        public KnittingJoViewModel(Order order, decimal quantity, GRNReciept reciept, bool jobOrderIssued, JobOrder parentJO)
        {
            this.Order = order;
            JO = new KnittingJO();
            JO.Order = order;
            JO.QuoteDate = order.OrderDate;
            JO.JoDate = DBResources.Instance.GetServerTime();
            JO.JobOrder = parentJO;
            JO.GRNReciept = reciept;

            JO.JoNoWrapper = "K" + (DBResources.Instance.Context.KnittingJOes.Count() + 1).ToString();
            JO.Add();
        }
 public bool SetOrder(Order order)
 {
     if (m_Order != order)
     {
         m_Products = new ObservableCollection<OrderProduct>(order.OrderProducts);
         m_Order = order;
         NotifyPropertyChanged("Products");
         if (m_Products.Count > 0)
             NotifyPropertyChanged("SelectedIndex");
         NotifyPropertyChanged("Order");
         SetAccess();
     }
     return true;
 }
Example #7
0
 public static string GetStyleInfo(Order order)
 {
     if (order != null)
     {
         StringBuilder sb = new StringBuilder();
         foreach (OrderProduct product in order.OrderProducts)
         {
             sb.AppendLine(product.StyleID + " : " + product.ProductName.Name);
         }
         return sb.ToString();
     }
     else
         return null;
 }
        public DyeingJoViewModel(Order order, decimal quantity, PurchaseOrder po, string grnRefNo, GRNReciept reciept, bool jobOrderIssued, JobOrder parentJo)
        {
            this.Order = order;
            JO = new DyeingJO();
            JO.Order = order;
            JO.QuoteDate = order.OrderDate;
            JO.JODate = DBResources.Instance.GetServerTime();
            JO.PurchaseOrder = po;
            JO.GRNRefNo = grnRefNo;

            JO.GRNReciept = reciept;
            JO.JobOrder = parentJo;
            JO.JoNo = "D" + (DBResources.Instance.Context.DyeingJOes.Count() + 1).ToString();

            JO.Add();
        }
        public void SetOrder(Order order)
        {
            Order = order;
            poViewer.SetOrder(Order);
            newPoCreator.SetOrder(Order);
            grnControl.Order = order;
            grnExpressView.SetOrder(order);
            if (DBResources.Instance.CurrentUser.UserRole.CanGeneratePurchaseOrder)
            {
                tabCreateNewPurchaseOrder.Visibility = System.Windows.Visibility.Visible;
                newPoCreator.Visibility = System.Windows.Visibility.Visible;
            }
            else
            {
                tabCreateNewPurchaseOrder.Visibility = System.Windows.Visibility.Collapsed;
                newPoCreator.Visibility = System.Windows.Visibility.Collapsed;
            }

        }
        public CreateNewPurchaseOrderViewModel(Order order, PurchaseOrder po) : this(order)
        {
            PurchaseOrder = po;

            //Only for PO generated from GRN failed quantity
            if (PurchaseOrder.ProductMaterialItems.Count == 0)
            {
                if (PurchaseOrder.OrderedItems.Count != 0)
                {
                    foreach (OrderedItem item in PurchaseOrder.OrderedItems)
                    {
                        item.PropertyChanged -= item_PropertyChanged;
                        item.PropertyChanged += item_PropertyChanged;

                        TotalPOValue += item.ItemCostInItemCurrency;
                    }
                }
            }
        }
Example #11
0
        public static string GetPurchaseOrderNumber(Company supplier, Order order)
        {
            string startYear = string.Empty;
            string endYear = string.Empty;
            int currentYear = int.Parse(DateTime.Now.ToString("yy"));
            string poUniqueNumber = order.OrderID.ToString() + "-" + (order.PurchaseOrders.Count + 1).ToString();
            string customerCode = order.Customer.Name.Substring(0, 2).ToUpper();
            if (DateTime.Now.Month >= 4)
            {
                startYear = currentYear.ToString();
                endYear = (currentYear + 1).ToString();
            }
            else
            {
                startYear = (currentYear - 1).ToString();
                endYear = currentYear.ToString();
            }

            return string.Format("TCIPL/{0}-{1}/{2}/{3}",startYear, endYear, customerCode, poUniqueNumber);
        }
Example #12
0
        public static string GetInvoiceNumber(Order order)
        {
            string startYear = string.Empty;
            string endYear = string.Empty;
            int currentYear = int.Parse(DateTime.Now.ToString("yy"));
            string invoiceUniqueNumber = order.OrderID.ToString() + "-" + (order.Invoices.Count + 1).ToString();
            string timeStamp = DateTime.Now.ToString("ddMMhhmmtt");

            if (DateTime.Now.Month >= 4)
            {
                startYear = currentYear.ToString();
                endYear = (currentYear + 1).ToString();
            }
            else
            {
                startYear = (currentYear - 1).ToString();
                endYear = currentYear.ToString();
            }


            return string.Format("INV/{0}-{1}/{2}/{3}", startYear, endYear, timeStamp, invoiceUniqueNumber);
        }
        public void SetOrder(Order order, PurchaseOrder po)
        {
            this.Order = order;
            ViewModel = new CreateNewPurchaseOrderViewModel(order, po);

            if (po.Approval == null)
            {
                btnChooseItems.Visibility = System.Windows.Visibility.Collapsed;
                poCurrencySelection.IsEnabled = false;
            }
            else if (po.Approval.IsApproved == null)
            {
                SetUIAccesibility(PurchaseOrderState.Generated);                
            }
            else if (po.Approval.IsApproved.Value == true)
            {
                SetUIAccesibility(PurchaseOrderState.Approved);
            }
            else
            {
                SetUIAccesibility(PurchaseOrderState.Rejeted);
            }
        }
Example #14
0
 public Order CreateNewOrder(Order newOrder, string userComment)
 {
     Order newSavedOrder = dbContext.Orders.Add(newOrder);
     History historyItem = new History();
     historyItem.Comment = userComment;
     historyItem.UserName = CurrentUser.UserName;
     historyItem.OrderChanges = "Created New Enquiry";
     historyItem.Date = DateTime.Now;
     newSavedOrder.Histories.Add(historyItem);
     Save();
     return newSavedOrder;
 }
 public PurchaseOrderSearchControlViewModel(Order order)
 {
     Order = order;
 }
 public void SetOrder(Order order)
 {
     ViewModel.Order = order;
 }
 public void SetOrder(Order order)
 {
     Order = order;
     joTypeSelection.Visibility = System.Windows.Visibility.Visible;
 }
        public bool SetOrder(Order order)
        {
            if (m_Order != order)
            {
                if (order != null)
                {
                    Products = new ObservableCollection<OrderProduct>(order.OrderProducts);
                    DeliveryDate = "Delivery Date: " + Convert.ToString(order.ExpectedDeliveryDate);
                }

                m_Order = order;
                NotifyPropertyChanged("Order");
            }

            if (DBResources.Instance.CurrentUser.UserRole.CanAddSubMaterials &&
                     Order.OrderStatu.OrderStatusID == (short)OrderStatusEnum.OrderConfirmed)
                AddDeleteButtonVisibility = Visibility.Visible;
            else
                AddDeleteButtonVisibility = Visibility.Hidden;

            return true;
        }
Example #19
0
 public void SetOrder(Order order)
 {
     Order = order;
     ViewModel = new POControlViewModel(order);          
 }
 public void CreateNewJo(Order order,decimal quantity,GRNReciept reciept, bool jobOrderIssued, JobOrder parentJo)
 {
     ViewModel = new KnittingJoViewModel(order, quantity, reciept, jobOrderIssued, parentJo);
     //budgetVsActualControl.Initialize(reciept.OrderedItem, parentJo);
 }
 public void SetOrder(Order order)
 {
     executionDetails.ItemsSource = order.OrderProducts;
 }
 public void CreateNewJo(Order order, decimal quantity, PurchaseOrder po, string grnRefNo, GRNReciept receipt, bool jobOrderIssued, JobOrder parentJo)
 {
     ViewModel = new DyeingJoViewModel(order, quantity, po, grnRefNo, receipt, jobOrderIssued,parentJo);
     //budgetVsActualControl.Initialize(receipt.OrderedItem, parentJo);
 }
 public GRNExpressViewModel(Order order) : base()
 {
     this.Order = order;
 }
 public MaterialStockPerOrderViewModel(Order order)
 {
     this.Order = order;
     SelectedOrder = order;
 }
Example #25
0
        public PurchaseOrder CreateNewPurchaseOrder(Order order, Company supplier, string purchseOrderNumber)
        {
            PurchaseOrder newPO = new PurchaseOrder();
            newPO.PurchaseOrderNumber = purchseOrderNumber;
            newPO.SupplierID = supplier.CompanyID;
            newPO.OrderID = order.OrderID;
            newPO.PurchaseOrderStatusID = 1;

            OrderManagerDBEntities newManager = new OrderManagerDBEntities();
            newManager.PurchaseOrders.Add(newPO);
            newManager.SaveChanges();
            newManager.Dispose();

            newPO = GetPurchaseOrder(purchseOrderNumber);

            return newPO;
        }
 public CartonBoxBrowserViewModel(Order order)
 {
     this.Order = order;
 }
 public CreateNewPurchaseOrderViewModel(Order order)
 {
     Order = order;
 }
 public POControlViewModel(Order order)
 {
     this.Order = order;
 }
 public BillOfMaterialBrowserViewModel(Order order, ObservableCollection<ProductMaterialItem> purchasableMaterials)
 {
     this.SetOrder(order);
     this.PurchasableMaterials = purchasableMaterials;
 }
 public void SetOrder(Order order)
 {
      ViewModel = new JobbOrderJOViewModel(order);
      supplierList.SelectedIndex = -1;
 }