コード例 #1
0
 /// <summary>删除主表,连同明细一起删除
 ///
 /// </summary>
 private void DoDelete()
 {
     m_BseModuleDAL.DeleteByCond("ProjectID=" + m_BseProject.ProjectID + "");
     m_BseProjectDAL.Delete(m_BseProject.ProjectID);
     m_lstBseProject.Remove(m_BseProject);
     m_BseProject = null;
     if (m_lstBseModule != null)
     {
         m_lstBseModule.Clear();
         objListViewDetail.SetObjects(m_lstBseModule);
         objListViewDetail.Refresh();
     }
     SetMode(EntityOperationType.只读);
 }
コード例 #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));
            }
        }