コード例 #1
0
ファイル: OrderServiceImpl.cs プロジェクト: zaieda/RetailPOS
        /// <summary>
        /// Save Order details in database
        /// </summary>
        /// <param name="orderDetails">ordermaster object to be saved</param>
        /// <returns>returns boolean value indicating if the records are saved in database</returns>
        bool IOrderService.SaveOrderDetail(OrderMasterDTO orderDetail)
        {
            ordermaster orderEntity = new ordermaster();

            ObjectMapper.Map(orderDetail, orderEntity);
            return(OrderMasterRepository.Save(orderEntity));
        }
コード例 #2
0
ファイル: OrderServiceImpl.cs プロジェクト: zaieda/RetailPOS
        /// <summary>
        /// Get set aside orders by customer Id
        /// </summary>
        /// <returns>returns list of set aside orders by customer Id</returns>
        OrderMasterDTO IOrderService.GetSetAsideOrders(int customerId)
        {
            OrderMasterDTO lstOrderMaster = new OrderMasterDTO();

            ObjectMapper.Map(base.OrderMasterRepository.GetList(item =>
                                                                item.customer_id == customerId && item.Status == 2).FirstOrDefault(), lstOrderMaster);
            return(lstOrderMaster);
        }
コード例 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ProductGridViewModel"/> class.
        /// </summary>
        public ProductGridViewModel()
        {
            LstProductDetails  = new ObservableCollection <ProductDTO>();
            LstCustomerDetail  = new ObservableCollection <CustomerDTO>();
            LstDiscountType    = new ObservableCollection <DiscountType>();
            LstSearchCustomer  = new List <CustomerDTO>();
            LstOrderMasterType = new OrderMasterDTO();
            LstOrderItems      = new List <OrderChildDTO>();

            Mediator.Register("SetSelectedProduct", SetSelectedProduct);
            Mediator.Register("SetSelectedCustomer", SetSelectedCustomer);
            Mediator.Register("SetSelectedOrder", SetSelectedOrder);

            GetDiscountType();

            ExitCommand                 = new RelayCommand(CloseApplication);
            LogOutCommand               = new RelayCommand(LogoutApplication);
            ClearProduct                = new RelayCommand(ClearGridProduct);
            SelectProductCommand        = new RelayCommand <object>(BindProductDetails);
            DeleteSelectedItem          = new RelayCommand(DeleteItem);
            OpenEditProductEntryPopUp   = new RelayCommand(OpenEditProductPopUp);
            EditProductCommand          = new RelayCommand(EditDataGridCommand);
            OpenSetAsideCustomerPopUp   = new RelayCommand(OpenSetAsidePopUp);
            SaveSetAsideOrderCommand    = new RelayCommand(SaveOrderWithItems);
            AddNewCustomerCommand       = new RelayCommand(AddNewCustomer);
            BindProductGridForOpenOrder = new RelayCommand <CustomerDTO>(BindProductGridOnSelectCustomer);
            ShowHideAddCustomerCommand  = new RelayCommand(ShowHideAddCustomerFields);
            NewOrderCommand             = new RelayCommand(ResetControls);
            SaveOrderInQueueCommand     = new RelayCommand(SaveOrderInQueue);
            OrderInQueueCommand         = new RelayCommand <OrderMasterDTO>(BindProductGridWithOrdersInQueue);
            AddDiscount                 = new RelayCommand(addDiscount);
            OpenDiscountentryPopUp      = new RelayCommand(OpenDiscountentryPopUpClick);
            GetSearchAttributes();

            IsVisibleOnAddNewCustomerClick = Visibility.Visible;
            IsErrorMessageVisible          = Visibility.Hidden;
            ClearControls();
        }
コード例 #4
0
ファイル: OrderServiceImpl.cs プロジェクト: zaieda/RetailPOS
        /// <summary>
        /// Update Order details in database
        /// </summary>
        /// <param name="orderDetails">ordermaster object to be updated</param>
        /// <returns>returns boolean value indicating if the records are updated in database</returns>
        bool IOrderService.UpdateOrderDetail(OrderMasterDTO orderDetail)
        {
            bool        isRecordUpdated = false;
            ordermaster orderEntity     = new ordermaster();

            ObjectMapper.Map(orderDetail, orderEntity);

            isRecordUpdated = OrderMasterRepository.Update(orderEntity);

            foreach (orderchild item in orderEntity.orderchilds)
            {
                if (item.order_id == 0)
                {
                    item.order_id   = orderEntity.id;
                    isRecordUpdated = OrderChildRepository.Save(item);
                }
                else
                {
                    isRecordUpdated = OrderChildRepository.Update(item);
                }
            }
            return(OrderMasterRepository.Update(orderEntity));
        }
コード例 #5
0
ファイル: OrderService.cs プロジェクト: zaieda/RetailPOS
 /// <summary>
 /// Update Order details in database
 /// </summary>
 /// <param name="orderDetails">ordermaster object to be updated</param>
 /// <returns>returns boolean value indicating if the records are updated in database</returns>
 public bool UpdateOrderDetail(OrderMasterDTO orderDetail)
 {
     return(OrderService.UpdateOrderDetail(orderDetail));
 }
コード例 #6
0
ファイル: OrderService.cs プロジェクト: zaieda/RetailPOS
 /// <summary>
 /// Save Order details in database
 /// </summary>
 /// <param name="orderDetails">ordermaster object to be saved</param>
 /// <returns>returns boolean value indicating if the records are saved in database</returns>
 public bool SaveOrderDetail(OrderMasterDTO orderDetail)
 {
     return(OrderService.SaveOrderDetail(orderDetail));
 }
コード例 #7
0
 private OrderMasterDTO InitializeOrderItems(int customerId, OrderStatus orderStatus, OrderMasterDTO orderDetails)
 {
     return(new OrderMasterDTO
     {
         Id = orderDetails == null ? 0 : orderDetails.Id,
         Order_No = "0001",
         Order_Date = DateTime.Now,
         Customer_Id = customerId,
         Shop_Code = "PSD-01",
         Invoice_Id = 64,
         Print_Receipt_Copies = 0,
         Status = (short)orderStatus,
         Discount_total = TotalDiscount,
         OrderChilds = InitializeOrderItemDetails()
     });
 }
コード例 #8
0
 private OrderMasterDTO InitializeOrderItems(int customerId, OrderStatus orderStatus, OrderMasterDTO orderDetails)
 {
     return new OrderMasterDTO
     {
         Id = orderDetails == null ? 0 : orderDetails.Id,
         Order_No = "0001",
         Order_Date = DateTime.Now,
         Customer_Id = customerId,
         Shop_Code = "PSD-01",
         Invoice_Id = 64,
         Print_Receipt_Copies = 0,
         Status = (short)orderStatus,
         Discount_total=TotalDiscount,
         OrderChilds = InitializeOrderItemDetails()
     };
 }
コード例 #9
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ProductGridViewModel"/> class.
        /// </summary>
        public ProductGridViewModel()
        {
            LstProductDetails = new ObservableCollection<ProductDTO>();
            LstCustomerDetail = new ObservableCollection<CustomerDTO>();
            LstDiscountType = new ObservableCollection<DiscountType>();
            LstSearchCustomer = new List<CustomerDTO>();
            LstOrderMasterType = new OrderMasterDTO();
            LstOrderItems = new List<OrderChildDTO>();

            Mediator.Register("SetSelectedProduct", SetSelectedProduct);
            Mediator.Register("SetSelectedCustomer", SetSelectedCustomer);
            Mediator.Register("SetSelectedOrder", SetSelectedOrder);

            GetDiscountType();

            ExitCommand = new RelayCommand(CloseApplication);
            LogOutCommand = new RelayCommand(LogoutApplication);
            ClearProduct = new RelayCommand(ClearGridProduct);
            SelectProductCommand = new RelayCommand<object>(BindProductDetails);
            DeleteSelectedItem = new RelayCommand(DeleteItem);
            OpenEditProductEntryPopUp = new RelayCommand(OpenEditProductPopUp);
            EditProductCommand = new RelayCommand(EditDataGridCommand);
            OpenSetAsideCustomerPopUp = new RelayCommand(OpenSetAsidePopUp);
            SaveSetAsideOrderCommand = new RelayCommand(SaveOrderWithItems);
            AddNewCustomerCommand = new RelayCommand(AddNewCustomer);
            BindProductGridForOpenOrder = new RelayCommand<CustomerDTO>(BindProductGridOnSelectCustomer);
            ShowHideAddCustomerCommand = new RelayCommand(ShowHideAddCustomerFields);
            NewOrderCommand = new RelayCommand(ResetControls);
            SaveOrderInQueueCommand = new RelayCommand(SaveOrderInQueue);
            OrderInQueueCommand = new RelayCommand<OrderMasterDTO>(BindProductGridWithOrdersInQueue);
            AddDiscount = new RelayCommand(addDiscount);
            OpenDiscountentryPopUp = new RelayCommand(OpenDiscountentryPopUpClick);
            GetSearchAttributes();

            IsVisibleOnAddNewCustomerClick = Visibility.Visible;
            IsErrorMessageVisible = Visibility.Hidden;
            ClearControls();
        }