Exemplo n.º 1
0
        public frmrptPartNos(UserInformation userInformation, WPF.MDI.MdiChild mdiChild, PRD_MAST productMaster = null, ReportMISProductInformationModel productInformationModel = null, DDCUST_MAST customerMaster = null, List <DDLOC_MAST> lstLocation = null, bool refreshOnLoad = false, string title = "Customer Partno Wise Report")
        {
            InitializeComponent();

            this.mdiChild     = mdiChild;
            vm                = new ReportMISProductInformationViewModel(userInformation, mdiChild, productMaster, productInformationModel, customerMaster, lstLocation, refreshOnLoad, title);
            this.DataContext  = vm;
            mdiChild.Closing += vm.CloseMethod;
            //if (vm.CloseAction == null && mdiChild.IsNotNullOrEmpty())
            //    vm.CloseAction = new Action(() => mdiChild.Close());
        }
        public ReportMISProductInformationViewModel(UserInformation userInformation, WPF.MDI.MdiChild mdiChild, PRD_MAST productMaster = null, ReportMISProductInformationModel productInformationModel = null, DDCUST_MAST customerMaster = null, List <DDLOC_MAST> lstLocation = null, bool refreshOnLoad = false, string title = REPORT_TITLE)
        {
            _userInformation = userInformation;
            this.mdiChild    = mdiChild;

            bll                        = new ReportMISProductInformationWise(userInformation);
            MandatoryFields            = new ReportMISProductInformationModel();
            MandatoryFields.GRID_TITLE = REPORT_TITLE;

            CustomersDataSource = bll.GetCustomerDetails().ToDataTable <DDCUST_MAST>().DefaultView;
            this.customerSelectedItemChangedCommand = new DelegateCommand(this.CustomerChanged);
            CustomerDropDownItems = new ObservableCollection <DropdownColumns>()
            {
                new DropdownColumns()
                {
                    ColumnName = "CUST_CODE", ColumnDesc = "Customer Code", ColumnWidth = "25*"
                },
                new DropdownColumns()
                {
                    ColumnName = "CUST_NAME", ColumnDesc = "Customer", ColumnWidth = "75*", IsDefaultSearchColumn = true
                }
            };

            SFLPartNumbersDataSource = bll.GetPartNumber().ToDataTable <PRD_MAST>().DefaultView;
            this.sflPartNumberSelectedItemChangedCommand = new DelegateCommand(this.SFLPartNumberChanged);
            SFLPartNumberDropDownItems = new ObservableCollection <DropdownColumns>()
            {
                new DropdownColumns()
                {
                    ColumnName = "PART_NO", ColumnDesc = "SFL Part Number", ColumnWidth = "1*"
                },
            };


            this.printCommand   = new DelegateCommand(this.PrintSubmitCommand);
            this.refreshCommand = new DelegateCommand(this.RefreshSubmitCommand);

            Items         = new Dictionary <string, object>();
            SelectedItems = new Dictionary <string, object>();
            SelectedItems.Add("All", "All");

            foreach (DDLOC_MAST locationMaster in bll.GetLocationDetails())
            {
                Items.Add(locationMaster.LOCATION + "(" + locationMaster.LOC_CODE + ")", locationMaster.LOC_CODE);
                SelectedItems.Add(locationMaster.LOCATION + "(" + locationMaster.LOC_CODE + ")", locationMaster.LOC_CODE);
            }

            DataTable dtPGCategory = bll.GetProductPGCategoryByPrimaryKey().ToDataTable <PG_CATEGORY>();

            if (dtPGCategory.Columns.Contains("PG_CAT_DESC"))
            {
                dtPGCategory.Columns["PG_CAT_DESC"].ColumnName = "PG_CATEGORY";
            }
            ProductPGCategoryDataSource = dtPGCategory.DefaultView;



            ProductPGCategoryDropDownItems = new ObservableCollection <DropdownColumns>()
            {
                new DropdownColumns()
                {
                    ColumnName = "PG_CAT", ColumnDesc = "Code", ColumnWidth = "25*"
                },
                new DropdownColumns()
                {
                    ColumnName = "PG_CATEGORY", ColumnDesc = " Product Group Category", ColumnWidth = "75*"
                }
            };



            this.productPGCategorySelectedItemChangedCommand = new DelegateCommand(this.productPGCategoryChanged);
            this.productPGCategoryEndEditCommand             = new DelegateCommand(this.productPGCategoryEndEdit);

            //Items.Add("Padi", "M");
            //Items.Add("KPM", "K");
            //Items.Add("Pondy", "Y");

            //SelectedItems.Add("All", "All");
            //SelectedItems.Add("Padi", "M");
            //SelectedItems.Add("KPM", "K");
            //SelectedItems.Add("Pondy", "Y");
        }