Exemplo n.º 1
0
        private void FrmLaneInfo_OnUpdateQuery(LaneInfoVM vm)
        {
            var item = _laneInfoList.SingleOrDefault(x => x.LANEINFO_PK == vm.LANEINFO_PK);

            Common.Helper.CopyProperties(vm, item);
            LaneNumberSort();
        }
Exemplo n.º 2
0
        private void InitControls()
        {
            _vm = new LaneInfoVM();

            DataBinding(txtLaneInfoPk, "Text", Masco.Core.Helper.Refrection.GetPropName <LaneInfoVM>(x => x.LANEINFO_PK));
            DataBinding(txtCheckListPK, "Text", Masco.Core.Helper.Refrection.GetPropName <LaneInfoVM>(x => x.CHECKLIST_PK));
            DataBinding(txtDirection, "Text", Masco.Core.Helper.Refrection.GetPropName <LaneInfoVM>(x => x.DIRECTION));
            DataBinding(txtImageCode, "Text", Masco.Core.Helper.Refrection.GetPropName <LaneInfoVM>(x => x.IMAGE_CODE));
            DataBinding(txtImageName, "Text", Masco.Core.Helper.Refrection.GetPropName <LaneInfoVM>(x => x.IMAGE_NAME));
            DataBinding(txtLaneName, "Text", Masco.Core.Helper.Refrection.GetPropName <LaneInfoVM>(x => x.LANE_NAME));
            DataBinding(txtNumber, "Text", Masco.Core.Helper.Refrection.GetPropName <LaneInfoVM>(x => x.NUMBER));
        }
Exemplo n.º 3
0
        private void btnLaneInfoAdd_Click(object sender, EventArgs e)
        {
            var dlg = new FrmLaneInfo();

            InitDialog(dlg);

            var item = new LaneInfoVM();

            item.CHECKLIST_PK = _vm.CHECKLIST_PK;
            dlg.Setup(item);
            dlg.OnInsertQuery = FrmLaneInfo_OnInsertQuery;

            dlg.ShowDialog(this);
        }
Exemplo n.º 4
0
        public void Setup(LaneInfoVM vm)
        {
            if (vm.LANEINFO_PK > 0)
            {
                btnInsert.Enabled = false;
            }
            else
            {
                btnUpdate.Enabled = false;
                btnDelete.Enabled = false;
            }

            Common.Helper.CopyProperties(vm, _vm);
        }
Exemplo n.º 5
0
 private void FrmLaneInfo_OnInsertQuery(LaneInfoVM vm)
 {
     //var pos = 0;
     //if (_laneInfoList.Count == 0)
     //    _laneInfoList.Add(vm);
     //else
     //{
     //    for (int idx = 0; idx < _laneInfoList.Count(); idx++)
     //    {
     //        if (vm.NUMBER >= _laneInfoList[idx].NUMBER)
     //        {
     //            _laneInfoList.Insert(idx, vm);
     //            break;
     //        }
     //    }
     //}
     _laneInfoList.Add(vm);
     LaneNumberSort();
 }