Exemple #1
0
        /// <summary>
        /// 开启
        /// </summary>
        private void BtnStart_Click(object sender, EventArgs e)
        {
            var selectRows = this.GirdCard.GetSelectedRows();

            if (selectRows.Length < 1)
            {
                throw new Exception("当前没有选中行!");
            }

            if (MsgBox.ShowYesNoMsg("确定打开所选流转卡?") != DialogResult.Yes)
            {
                return;
            }

            List <CardMain> cards = new List <CardMain>();

            foreach (int i in this.GirdCard.GetSelectedRows())
            {
                var cardm = ConvertToModel.DataRowToModel <CardMain>(GirdCard.GetDataRow(i));
                cards.Add(cardm);
            }

            dal.SetPauseStatus(false, null, cards.ToArray());

            //刷新
            this.ExecQuery();
        }
Exemple #2
0
        private void BtnDelCard_Click(object sender, EventArgs e)
        {
            #region  除流转卡

            if (MsgBox.ShowYesNoMsg("确定删除选定的流转卡?") != DialogResult.Yes)
            {
                return;
            }

            StringBuilder sb = new StringBuilder();

            foreach (int handle in this.GirdCard.GetSelectedRows())
            {
                string[] wheres = new string[]
                {
                    "cardNo = @cardNo"
                };

                var card = ConvertToModel.DataRowToModel <CardMain>(GirdCard.GetDataRow(handle));

                //引用校验
                dal.ExistRef(card.CardNo);

                if (card.curOpSeq != "0010")
                {
                    sb.Append("流转卡" + card.CardNo + "已经报工,不能删除! \r\n");
                }
                else
                {
                    dal.Delete(card.CardNo);
                }
            }

            if (sb.ToString() == "")
            {
                sb.Append("删除成功!");
            }

            MsgBox.ShowInfoMsg(sb.ToString());

            this.BtnReflash_Click(null, null);

            #endregion
        }