Exemplo n.º 1
0
        /// <summary>
        /// 交换机取消放电
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void switchCancelDischarge_Click(object sender, EventArgs e)
        {
            try
            {
                var node = treeViewSwitch.SelectedNode;
                if (node == null)
                {
                    XtraMessageBox.Show("请先选择需操作的项。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
                var mac = node.Name;
                ChargeMrg.SendSwitchesDControl(mac, 1);

                //ChargeMrg.MacPowerboxchargehistoryUpdate(mac);//更新放电结束时间
                XtraMessageBox.Show("操作成功。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            catch (Exception exc)
            {
                XtraMessageBox.Show(exc.ToString(), "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 交换机执行放电
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void switchExecuteDischarge_Click(object sender, EventArgs e)
        {
            try
            {
                var node = treeViewSwitch.SelectedNode;
                if (node == null)
                {
                    XtraMessageBox.Show("请先选择需操作的项。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
                var mac = node.Name;
                ChargeMrg.SendSwitchesDControl(mac, 2);

                //写放电记录  20180124
                ChargeMrg.AddPowerboxchargehistory(0, mac);

                XtraMessageBox.Show("操作成功。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            catch (Exception exc)
            {
                XtraMessageBox.Show(exc.ToString(), "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }