예제 #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (!ValidatePage())
            {
                return;
            }

            if (CurrEditMode == eEditMode.新增)
            {
                if (this.SelFuelKind == null)
                {
                    return;
                }
                CmcsCMEquipment entity = new CmcsCMEquipment();
                entity.EquipmentName = txt_EquipMentName.Text;
                entity.EquipmentCode = txt_EquipMentCode.Text;
                entity.NodeCode      = commonDAO.GetCMEquipMentNewChildCode(this.SelFuelKind.NodeCode);
                entity.Sequence      = dbi_Sequence.Value;
                entity.Parentid      = this.SelFuelKind.Id;
                entity.InterfaceType = txt_InterfaceType.Text;
                entity.SampleMachine = txt_SampleMachine.Text;
                Dbers.GetInstance().SelfDber.Insert <CmcsCMEquipment>(entity);
            }
            else if (CurrEditMode == eEditMode.修改)
            {
                if (this.SelFuelKind == null)
                {
                    return;
                }
                this.SelFuelKind.EquipmentName = txt_EquipMentName.Text;
                this.SelFuelKind.EquipmentCode = txt_EquipMentCode.Text;
                this.SelFuelKind.Sequence      = dbi_Sequence.Value;
                this.SelFuelKind.InterfaceType = txt_InterfaceType.Text;
                this.SelFuelKind.SampleMachine = txt_SampleMachine.Text;
                Dbers.GetInstance().SelfDber.Update <CmcsCMEquipment>(this.SelFuelKind);
            }

            InitTree();
        }