Ejemplo n.º 1
0
        /// <summary>
        /// 删除按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tsbDelete_Click(object sender, EventArgs e)
        {
            if (this.grdViewGroups.FocusedRowHandle < 0)
            {//不存在行焦点
                //请选择需要删除的数据!
                MessageService.ShowMessage("${res:FanHai.Hemera.Addins.EMS.EquipmentGroups.M0007}", "${res:Global.InformationText}");
                return;
            }

            if (MessageService.AskQuestion("${res:FanHai.Hemera.Addins.EMS.EquipmentGroups.M0005}", "${res:Global.QuestionText}"))
            {//系统提示确定删除吗? 返回值为true执行以下操作
                equipmentGroupEntity = new EquipmentGroupEntity();
                //状态改为delete
                State = ControlState.Delete;
                //赋值对象equipmentGroupEntity的值
                MapControlsToEntity();

                if (equipmentGroupEntity.Delete())
                {                          //清除成功返回值为true
                    MapEntityToControls(); //赋值对象equipmentGroupEntity的值
                    //系统提示删除数据成功!
                    MessageService.ShowMessage("${res:FanHai.Hemera.Addins.EMS.EquipmentGroups.M0006}", "${res:Global.InformationText}");
                    //修改状态为Read
                    State = ControlState.Read;
                }
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 新增按钮
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void tsbNew_Click(object sender, EventArgs e)
 {
     //重新创建对象
     equipmentGroupEntity = new EquipmentGroupEntity();
     //状态修改为new
     State = ControlState.New;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 取消按钮
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void tsbCancel_Click(object sender, EventArgs e)
 {
     equipmentGroupEntity = null;
     //状态为Read
     State = ControlState.Read;
     //获取数据表dategridview行焦点,获取行数据
     grdViewGroups_FocusedRowChanged(this.grdViewGroups, new FocusedRowChangedEventArgs(-1, this.grdViewGroups.FocusedRowHandle));
 }
Ejemplo n.º 4
0
        /// <summary>
        /// 刷新按钮Click事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tsbRefresh_Click(object sender, EventArgs e)
        {
            //页面重新载入
            LoadEquipmentGroupsData();

            equipmentGroupEntity = null;
            //状态修改为Read
            State = ControlState.Read;
            //获取数据表dategridview行焦点,获取行数据
            grdViewGroups_FocusedRowChanged(this.grdViewGroups, new FocusedRowChangedEventArgs(-1, this.grdViewGroups.FocusedRowHandle));
        }
Ejemplo n.º 5
0
        private void grdGroups_DoubleClick(object sender, EventArgs e)
        {
            GridHitInfo gridHitInfo = this.grdViewGroups.CalcHitInfo((sender as Control).PointToClient(Control.MousePosition));

            if (gridHitInfo.RowHandle >= 0)
            {
                equipmentGroupEntity = new EquipmentGroupEntity();
                //状态修改
                State = ControlState.Edit;

                grdViewGroups_FocusedRowChanged(this.grdViewGroups, new FocusedRowChangedEventArgs(-1, this.grdViewGroups.FocusedRowHandle));
            }
        }