Exemplo n.º 1
0
 public void AddPanel(Param.Screen screen)
 {
     switch (screen)
     {
         case Param.Screen.Sale:
             if (_UC_SALE == null) _UC_SALE = new UcSale();
             _USER_CONTROL = _UC_SALE;
             _UC_SALE.LoadData();
             break;
         case Param.Screen.ReceiveProduct:
             if (_UC_RECEIVE_PRODUCT == null) _UC_RECEIVE_PRODUCT = new UcReceiveProduct();
             _USER_CONTROL = _UC_RECEIVE_PRODUCT;
             _UC_RECEIVE_PRODUCT._FIRST_LOAD = true;
             _UC_RECEIVE_PRODUCT.LoadData();
             _UC_RECEIVE_PRODUCT.SearchData();
             break;
         case Param.Screen.Stock:
             if (_UC_STOCK == null) _UC_STOCK = new UcStock();
             _USER_CONTROL = _UC_STOCK;
             _UC_STOCK.LoadData();
             break;
         case Param.Screen.Product:
             if (_UC_PRODUCT == null) _UC_PRODUCT = new UcProduct();
             _USER_CONTROL = _UC_PRODUCT;
             _UC_PRODUCT._FIRST_LOAD = true;
             _UC_PRODUCT.LoadData();
             break;
         case Param.Screen.Customer:
             if (_UC_CUSTOMER == null) _UC_CUSTOMER = new UcCustomer();
             _USER_CONTROL = _UC_CUSTOMER;
             _UC_CUSTOMER.LoadData();
             break;
         case Param.Screen.Report:
             if (_UC_REPORT == null) _UC_REPORT = new UcReport();
             _USER_CONTROL = _UC_REPORT;
             _UC_REPORT.LoadData();
             break;
         case Param.Screen.Config:
             if (_UC_CONFIG == null) _UC_CONFIG = new UcConfig();
             _USER_CONTROL = _UC_CONFIG;
             _UC_CONFIG.LoadData();
             break;
         case Param.Screen.Claim:
             if (_UC_CLAIM == null) _UC_CLAIM = new UcClaim();
             _USER_CONTROL = _UC_CLAIM;
             break;
         case Param.Screen.ReportStock:
             if (_UC_REPORT_STOCK == null) _UC_REPORT_STOCK = new UcReportStock();
             _USER_CONTROL = _UC_REPORT_STOCK;
             break;
         case Param.Screen.Credit:
             if (_UC_CREDIT == null) _UC_CREDIT = new UcCredit();
             _USER_CONTROL = _UC_CREDIT;
             _UC_CREDIT.LoadData();
             break;
         case Param.Screen.ReportProduct:
             if (_UC_REPORT_PORDUCT == null) _UC_REPORT_PORDUCT = new UcReportProduct();
             _USER_CONTROL = _UC_REPORT_PORDUCT;
             _UC_REPORT_PORDUCT.LoadData();
             break;
     }
     if (!pnlMain.Contains(_USER_CONTROL))
     {
         pnlMain.Controls.Clear();
         _USER_CONTROL.Dock = DockStyle.Fill;
         pnlMain.Controls.Add(_USER_CONTROL);
     }
 }
Exemplo n.º 2
0
        public void AddPanel(Param.Screen screen)
        {
            switch (screen)
            {
            case Param.Screen.Sale:
                if (_UC_SALE == null)
                {
                    _UC_SALE = new UcSale();
                }
                _USER_CONTROL = _UC_SALE;
                _UC_SALE.LoadData();
                break;

            case Param.Screen.ReceiveProduct:
                if (_UC_RECEIVE_PRODUCT == null)
                {
                    _UC_RECEIVE_PRODUCT = new UcReceiveProduct();
                }
                _USER_CONTROL = _UC_RECEIVE_PRODUCT;
                _UC_RECEIVE_PRODUCT._FIRST_LOAD = true;
                _UC_RECEIVE_PRODUCT.LoadData();
                _UC_RECEIVE_PRODUCT.SearchData();
                break;

            case Param.Screen.Stock:
                if (_UC_STOCK == null)
                {
                    _UC_STOCK = new UcStock();
                }
                _USER_CONTROL = _UC_STOCK;
                _UC_STOCK.LoadData();
                break;

            case Param.Screen.Product:
                if (_UC_PRODUCT == null)
                {
                    _UC_PRODUCT = new UcProduct();
                }
                _USER_CONTROL           = _UC_PRODUCT;
                _UC_PRODUCT._FIRST_LOAD = true;
                _UC_PRODUCT.LoadData();
                break;

            case Param.Screen.Customer:
                if (_UC_CUSTOMER == null)
                {
                    _UC_CUSTOMER = new UcCustomer();
                }
                _USER_CONTROL = _UC_CUSTOMER;
                _UC_CUSTOMER.LoadData();
                break;

            case Param.Screen.Report:
                if (_UC_REPORT == null)
                {
                    _UC_REPORT = new UcReport();
                }
                _USER_CONTROL = _UC_REPORT;
                _UC_REPORT.LoadData();
                break;

            case Param.Screen.Config:
                if (_UC_CONFIG == null)
                {
                    _UC_CONFIG = new UcConfig();
                }
                _USER_CONTROL = _UC_CONFIG;
                _UC_CONFIG.LoadData();
                break;

            case Param.Screen.Claim:
                if (Param.shopClaim == true)
                {
                    if (_UC_CLAIM == null)
                    {
                        _UC_CLAIM = new UcClaim();
                    }
                    _USER_CONTROL = _UC_CLAIM;
                }
                else
                {
                    if (_UC_DATA_CLAIM == null)
                    {
                        _UC_DATA_CLAIM = new UcAddDataClaim();
                    }
                    _USER_CONTROL = _UC_DATA_CLAIM;
                }
                break;

            //case Param.Screen.Claim:
            //    if (_UC_DATA_CLAIM == null) _UC_DATA_CLAIM = new UcAddDataClaim();
            //    _USER_CONTROL = _UC_DATA_CLAIM;
            //    break;
            case Param.Screen.ReportStock:
                if (_UC_REPORT_STOCK == null)
                {
                    _UC_REPORT_STOCK = new UcReportStock();
                }
                _USER_CONTROL = _UC_REPORT_STOCK;
                break;

            case Param.Screen.Credit:
                if (_UC_CREDIT == null)
                {
                    _UC_CREDIT = new UcCredit();
                }
                _USER_CONTROL = _UC_CREDIT;
                _UC_CREDIT.LoadData();
                break;

            case Param.Screen.ReportProduct:
                if (_UC_REPORT_PORDUCT == null)
                {
                    _UC_REPORT_PORDUCT = new UcReportProduct();
                }
                _USER_CONTROL = _UC_REPORT_PORDUCT;
                _UC_REPORT_PORDUCT.LoadData();
                break;

            case Param.Screen.claimShop:
                if (_UC_CLAIM_SHOP == null)
                {
                    _UC_CLAIM_SHOP = new UcClaimShop();
                }
                _USER_CONTROL = _UC_CLAIM_SHOP;
                _UC_CLAIM_SHOP.LoadData();
                break;

            case Param.Screen.claimReceived:
                if (_UC_CLAIM_RECEIVED == null)
                {
                    _UC_CLAIM_RECEIVED = new UcClaimReceived();
                }
                _USER_CONTROL = _UC_CLAIM_RECEIVED;
                break;
            }
            if (!pnlMain.Contains(_USER_CONTROL))
            {
                pnlMain.Controls.Clear();
                _USER_CONTROL.Dock = DockStyle.Fill;
                pnlMain.Controls.Add(_USER_CONTROL);
            }
        }