Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SalesOrderListViewModel"/> class.
        /// </summary>
        public RefundToCustomersViewModel(IRegionManager regionManager, IEventAggregator eventAggregator)
            : base()
        {
            this.regionManager   = regionManager;
            this.eventAggregator = eventAggregator;
            this.LoadCustomerBackground();

            NavigateToClientCommand = new RelayCommand(NavigateFromCustomer);
            SaveCommand             = new RelayCommand(OnSavePS, CanSave);
            RefreshCommand          = new RelayCommand(refreshcommand);
            SelectChangedCommand    = new RelayCommand(GetPSData);
            NewPSCommand            = new RelayCommand(GetNewPS);
            NavigaetoSalesCommand   = new RelayCommand(NavigatetoSalesOrder);
            NavigaetoOrderCommand   = new RelayCommand(NavigatetoSalesOrder);
            SalesNoChangedCommand   = new RelayCommand(OnSalesNoChange);
            CashCheckedCommand      = new RelayCommand(OnCashChecked);
            ChequeCheckedCommand    = new RelayCommand(OnChequeChecked);


            List <CustomerEntity>        lst             = new List <CustomerEntity>();
            List <CustomerEntity>        lst1            = new List <CustomerEntity>();
            IRefundToCustomersRepository SalesRepository = new RefundToCustomersRepository();

            POCount = psRepository.GetCountOfPOCustomer(out lst1);
            PICount = psRepository.GetCountOfDNCustomer(out lst);
            if (lst != null)
            {
                this.ListCustomers = lst;
            }

            this.AccountDetails = accRepository.GetAccountDetails().Where(e => e.AccountType == 2 || e.AccountType == 3).ToList();
            if (!String.IsNullOrEmpty(SharedValues.NewClick))
            {
                if (SharedValues.NewClick != "New")
                {
                    IsCashChequeEnabled = false;
                    IsTextBoxReadOnly   = true;
                    IsCustomerEnabled   = false;
                    GetRefundToCustomerDetails(SharedValues.NewClick);
                }
                else if (SharedValues.NewClick == "New")
                {
                    IsCashChequeEnabled = true;
                    IsTextBoxReadOnly   = false;
                    IsCustomerEnabled   = true;
                    GetNewPS();
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SalesOrderListViewModel"/> class.
        /// </summary>
        public RefundToCustomersViewModel(IRegionManager regionManager, IEventAggregator eventAggregator)
            : base()
        {
            this.regionManager   = regionManager;
            this.eventAggregator = eventAggregator;
            this.LoadCustomerBackground();
            CloseCommand            = new DelegateCommand(Close);
            NavigateToClientCommand = new RelayCommand(NavigateFromCustomer);
            SaveCommand             = new RelayCommand(OnSavePS, CanSave);
            RefreshCommand          = new RelayCommand(refreshcommand);
            SelectChangedCommand    = new RelayCommand(GetPSData);
            NewPSCommand            = new RelayCommand(GetNewPS);
            NavigaetoSalesCommand   = new RelayCommand(NavigatetoSalesOrder);
            NavigaetoOrderCommand   = new RelayCommand(NavigatetoSalesOrder);
            SalesNoChangedCommand   = new RelayCommand(OnSalesNoChange);
            CashCheckedCommand      = new RelayCommand(OnCashChecked);
            ChequeCheckedCommand    = new RelayCommand(OnChequeChecked);


            List <CustomerEntity>        lst             = new List <CustomerEntity>();
            List <CustomerEntity>        lst1            = new List <CustomerEntity>();
            IRefundToCustomersRepository SalesRepository = new RefundToCustomersRepository();

            POCount = psRepository.GetCountOfPOCustomer(out lst1);
            PICount = psRepository.GetCountOfDNCustomer(out lst);
            int custId = 0;

            if (lst != null)
            {
                this.ListCustomers = lst;
            }
            if (this.ListCustomers.Count > 0)
            {
                int CustomerSelectedId = 0;
                if (SharedValues.getValue != null)
                {
                    bool isValid = Int32.TryParse(SharedValues.getValue, out CustomerSelectedId);
                }
                if (CustomerSelectedId != 0)
                {
                    this.SelectedCustomerID = CustomerSelectedId;
                }
                else
                {
                    // custId = this.ListCustomers[0].CustomerID;
                    //this.SelectedCustomerID = custId;
                    //GetPSData(this.SelectedCustomerID);
                }
            }
            this.AccountDetails = rmRepository.GetAccountDetails().Where(e => e.AccountType == Convert.ToInt32(Account_Type.Bank) || e.AccountType == Convert.ToInt32(Account_Type.Cash) || e.AccountType == Convert.ToByte(Account_Type.CreditCard)).ToList();
            if (!String.IsNullOrEmpty(SharedValues.NewClick))
            {
                if (SharedValues.NewClick != "New")
                {
                    MustCompare         = false;
                    IsCashChequeEnabled = false;
                    IsTextBoxReadOnly   = true;
                    IsCustomerEnabled   = false;
                    GetRefundToCustomerDetails(SharedValues.NewClick);
                }
                else if (SharedValues.NewClick == "New")
                {
                    MustCompare         = true;
                    IsCashChequeEnabled = true;
                    IsTextBoxReadOnly   = false;
                    IsCustomerEnabled   = true;
                    GetNewPS();
                }
            }
        }