示例#1
0
        /// <summary>
        /// 其他附件文件下载
        /// 2017/06/13(zhuguanjun)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void gridFile_CellClick(object sender, DevComponents.DotNetBar.SuperGrid.GridCellClickEventArgs e)
        {
            if (e.GridCell.GridColumn.Name == "RowDownLoad")
            {
                string fileName = e.GridCell.GridRow.GetCell("Path").Value.ToString();
                if (string.IsNullOrEmpty(fileName))
                {
                    MessageHelper.ShowMsg(MessageID.W000000005, MessageType.Alert);
                    return;
                }

                //文件下载
                FileHelper.DownLoadFile(UploadType.ContractQTFJ, ProjectId, null, fileName);
            }
        }
示例#2
0
 /// <summary>
 /// 删除按钮
 /// 2017/05/05(zhuguanjun)
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void superGridControl1_CellClick(object sender, DevComponents.DotNetBar.SuperGrid.GridCellClickEventArgs e)
 {
     if (e.GridCell.GridColumn.Name == "Delete")
     {
         string dm        = e.GridCell.GridRow.Cells["ID"].Value.ToString();
         bool   IsSuccess = bll.Delete(dm);
         if (IsSuccess)
         {
             MessageBox.Show("删除成功");
             DataBind();
         }
         else
         {
             MessageBox.Show("删除失败");
         }
     }
 }
示例#3
0
        /// <summary>
        /// 点击近期工作和问题一览时
        /// Created:2017.03.29(Xuxb)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void superGridLastWork_CellClick(object sender, DevComponents.DotNetBar.SuperGrid.GridCellClickEventArgs e)
        {
            if (e.GridCell.GridColumn.Name == "Operate")
            {
                string    WorkType = e.GridCell.GridRow.Cells["WorkType"].Value.ToString();
                MainFrame mainForm = (MainFrame)this.Parent.TopLevelControl;

                if (WorkType == "日常工作")
                {
                    Forms.Others.Routine form = new Forms.Others.Routine("");
                    form.WorkId = e.GridCell.GridRow.Cells["Id"].Value.ToString();
                    mainForm.ShowChildForm(form);
                }
                else
                {
                    Forms.Others.Trouble form = new Forms.Others.Trouble("");
                    form.TroubleId = e.GridCell.GridRow.Cells["Id"].Value.ToString();
                    mainForm.ShowChildForm(form);
                }
            }
        }
示例#4
0
        /// <summary>
        /// Handles invocation of CellInfoClick events
        /// </summary>
        internal void DoCellInfoClickEvent(GridCell gridCell, MouseEventArgs e)
        {
            if (CellInfoClick != null)
            {
                GridCellClickEventArgs ev = new
                    GridCellClickEventArgs(gridCell.GridPanel, gridCell, e);

                CellInfoClick(this, ev);
            }
        }
示例#5
0
        /// <summary>
        /// Handles invocation of CellClick events
        /// </summary>
        internal bool DoCellClickEvent(GridCell gridCell, MouseEventArgs e)
        {
            if (CellClick != null)
            {
                GridCellClickEventArgs ev = new
                    GridCellClickEventArgs(gridCell.GridPanel, gridCell, e);

                CellClick(this, ev);

                return (ev.Cancel);
            }

            return (false);
        }
示例#6
0
    private void shiplist_CellClick(object sender, GridCellClickEventArgs e)
    {
        dynamic obj = sender;
            if(e.GridCell.ColumnIndex<1 || e.GridCell.ColumnIndex >6)
            {
                return;
            }
            int fleetid = e.GridCell.RowIndex + 1;
            UserFleet uf = GameData.instance.GetFleetOfId(fleetid);
            if(uf==null|| uf.ships== null )
            {
                return;
            }
            int clickshippos = e.GridCell.ColumnIndex - 1;
            int shipid = 0;
            if(clickshippos < uf.ships.Length )
            {
                shipid = uf.ships[clickshippos];
            }

            if (z.instance.isFleetInBattle(fleetid))
            {
                MessageBox.Show("舰队正在战斗中");
                return;
            }

            if (GameData.instance.IsFleetInExplore(fleetid))
            {
                MessageBox.Show("舰队正在远征中");
                return;
            }

            var shipdialog = new ShipForm();

            shipdialog.setfleet_id(fleetid, clickshippos, shipid);
            shipdialog.ShowDialog();
            shipdialog.Dispose();
    }
 private void gridBlocks_CellClick(object sender, GridCellClickEventArgs e)
 {
     if (e.GridCell.ColumnIndex == 5)
     {
         GridPanel panel = gridDevice.PrimaryGrid;
         GridRow row = e.GridCell.GridRow;
         PowerBlock block = (PowerBlock)row.Tag;
         Device owner = DeviceManager.getBlockOwner(block.ID);
         DeviceManager.DeleteBlock(block.ID);
         int newDevID = (int)row.Cells[4].Value;
         if (newDevID == -1)
         {
             Color c = sensorColorDict[block.ClientID << 8 | block.SensorID];
             SetCellColor(row.Cells[0], c);
         }
         else
         {
             Device dev;
             if (newDevID == -2)
             {
                 dev = DeviceManager.NullDevice;
             }
             else
             {
                 dev = DeviceManager.getByID(newDevID);
             }
             bool isValid = true;
             if (!dev.BlockList.Exists(l => l == block.ID))
             {
                 if (dev != DeviceManager.NullDevice)
                 {
                     foreach (long l in dev.BlockList)
                     {
                         PowerBlock block1 = LogManager.PowerBlockList[l];
                         if (isTimeOverlap(block.BeginTime, block.EndTime, block1.BeginTime, block1.EndTime))
                         {
                             isValid = false;
                             MessageBoxEx.Show(this, "<font size='18'><b>Hai cảm biến không được đo cùng một thiết bị tại cùng thời điểm !</b></font>",
                                 "<font size='15'><b>Thông báo</b></font>", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                             break;
                         }
                     }
                 }
                 if (isValid)
                 {
                     dev.BlockList.Add(block.ID);
                     dev.BlockList.Sort((l1, l2) => l1.CompareTo(l2));
                 }
             }
             if (isValid)
             {
                 if (newDevID == -2 || owner == null || owner.ID != newDevID)
                     SetCellColor(row.Cells[0], Color.Gray);
             }
             else
             {
                 e.GridCell.GridRow.RowDirty = false;
                 e.GridCell.GridRow.Cells[4].Value = -2;
             }
         }
         DeviceManager.SaveDeviceList();
         cbDeviceHisStatisCompareUpdate();
     }
 }