예제 #1
0
 /// <summary>
 /// 取消一个选项,外部调用
 /// </summary>
 /// <param name="p_ISN"></param>
 public override void UCCancelOne(string p_ISN)
 {
     DataRow[] drA = UCDataSource.Select("BoxNo=" + SysString.ToDBString(p_ISN));
     if (drA.Length == 1)
     {
         drA[0]["SelectFlag"] = 0;
     }
 }
예제 #2
0
        /// <summary>
        /// 磁贴选择改变事件
        /// </summary>
        /// <param name="sender"></param>
        void UCFabLTile_CheckChanged(object sender)
        {
            if (tempTileShifFlag)//在执行Shift事件中,不执行,防止死循环
            {
                return;
            }
            tempTileShifFlag = true;

            UCFabLTileSimple ucft = (UCFabLTileSimple)sender;

            DataRow[] drA = UCDataSource.Select(" BoxNo=" + SysString.ToDBString(ucft.UCISN));
            if (drA.Length == 1)
            {
                drA[0]["SelectFlag"] = SysConvert.ToInt32(ucft.UCChecked);
            }

            if ((Control.ModifierKeys & Keys.Shift) == Keys.Shift)                  //按住了Shift键盘
            {
                if (UCCurrnetFocusIndex != -1)                                      //前一聚焦行号已存在
                {
                    for (int i = UCCurrnetFocusIndex + 1; i < ucft.UCRowIndex; i++) //防止死循环调用
                    {
                        UCDataSource.Rows[i]["SelectFlag"] = ucft.UCChecked;
                    }

                    foreach (Control ctl in panGroup.Controls)
                    {
                        if (ctl is UCFabLTileSimple)
                        {
                            UCFabLTileSimple ucf = (UCFabLTileSimple)ctl;
                            if (ucf.UCRowIndex >= UCCurrnetFocusIndex + 1 && ucf.UCRowIndex <= ucft.UCRowIndex)
                            {
                                ucf.UCChecked = ucft.UCChecked;
                            }
                        }
                    }
                }
            }


            UCCurrnetFocusIndex = ucft.UCRowIndex;
            tempTileShifFlag    = false;
        }