/// <summary>删除/作废
        ///
        /// </summary>
        /// <param name="strOperation">操作类型</param>
        private void DoDeleteOrCancel(string strOperation)
        {
            string strMsg = CheckSelect(strOperation);

            if (strMsg != string.Empty)
            {
                MessageBox.Show(strMsg);
                return;
            }
            string strIds    = DataGridViewHelper.GetColumnValuesBySelectRows(grdData.SelectedRows, gridmrzProjectID.Name);
            var    blnReturn = strOperation == "删除" ? m_BseProjectDAL.DeleteByCond(" ProjectID in (" + strIds + ")") : m_BseProjectDAL.Update("Status =0", " ProjectID in (" + strIds + ")");

            if (blnReturn)
            {
                MessageBox.Show(string.Format("{0}成功", strOperation));
                DoQueryData();
            }
            else
            {
                MessageBox.Show(string.Format("{0}失败", strOperation));
            }
        }
示例#2
0
        /// <summary>删除/作废
        ///
        /// </summary>
        /// <param name="strOperation">操作类型</param>
        private void DoDeleteOrCancel(string strOperation)
        {
            string strMsg = CheckSelect(strOperation);

            if (strMsg != string.Empty)
            {
                MessageBox.Show(strMsg);
                return;
            }
            string strIds    = DataGridViewHelper.GetColumnValuesBySelectRows(grdData.SelectedRows, gridmrzId.Name);
            var    blnReturn = strOperation.Trim() == "删除" ? m_CacheConfigDAL.Delete(int.Parse(strIds)) : m_CacheConfigDAL.Update("Status =0", " Id in (" + strIds + ")");

            if (blnReturn)
            {
                MessageBox.Show(string.Format("{0}成功", strOperation));
                DoQueryData();
            }
            else
            {
                MessageBox.Show(string.Format("{0}失败", strOperation));
            }
        }