コード例 #1
0
        private void InitializeScreen()
        {
            shtView.ActiveSkin = Common.ACTIVE_SKIN;

            // Mapping DataField.
            CtrlUtil.MappingDataFieldWithEnum(shtView, typeof(eColView));

            txtItem.KeyPress      += CtrlUtil.SetNextControl;
            txtLocation.KeyPress  += CtrlUtil.SetNextControl;
            txtLotNo.KeyPress     += CtrlUtil.SetNextControl;
            txtInvPeriod.KeyPress += CtrlUtil.SetNextControl;
            txtOnHandQty.KeyPress += CtrlUtil.SetNextControl;
            cboItemType.KeyPress  += CtrlUtil.SetNextControl;


            // Set default Column Cell Type.
            LookupDataBIZ bizLookupData = new LookupDataBIZ();

            LookupData transTypelookupData    = bizLookupData.LoadLookupClassType(DataDefine.TRANS_TYPE.ToNZString());
            LookupData refClassTypelookupData = bizLookupData.LoadLookupClassType(DataDefine.REF_SLIP_CLS.ToNZString());

            shtView.Columns[(int)eColView.TRANS_INFO].CellType = CtrlUtil.CreateReadOnlyPairCellType(transTypelookupData);
            shtView.Columns[(int)eColView.REF_TYPE].CellType   = CtrlUtil.CreateReadOnlyPairCellType(refClassTypelookupData);
            shtView.Columns[(int)eColView.TRANS_DATE].CellType = CtrlUtil.CreateDateTimeCellType(Common.CurrentUserInfomation.DateFormatString);

            cboItemType.Format += Common.ComboBox_Format;
            LookupData itemTypelookupData = bizLookupData.LoadLookupClassType(DataDefine.ITEM_CLS.ToNZString());

            cboItemType.LoadLookupData(itemTypelookupData);
            // Enable/Disable Controls
            CtrlUtil.EnabledControl(false, txtItem, txtLocation, txtLotNo, txtInvPeriod, txtOnHandQty, txtUnitMeasure, txtPackNo);
            CtrlUtil.EnabledControl(true, fpView);

            // Load data.
            txtItem.Text      = ItemCode.NVL(string.Empty);
            txtLocation.Text  = WareHouseCode.NVL(string.Empty);
            txtLotNo.Text     = LotNo.NVL(string.Empty);
            txtInvPeriod.Text = String.Format("{0} - {1}",
                                              CtrlUtil.ConvertDateTimeToCurrentFormat(PeriodBeginDate),
                                              CtrlUtil.ConvertDateTimeToCurrentFormat(PeriodEndDate));

            CtrlUtil.EnabledControl(false, cboItemType);
            LoadData();
        }