コード例 #1
0
        // 物理删除由主键proID指定的一条记录 DeleteProvince
        public bool Delete(int proID)
        {
            ProvinceDelete exec = new ProvinceDelete();

            try
            {
                exec.ProID = proID;
                exec.ExecNoQuery();
                return(true);
            }
            catch (Exception ex)
            {
                //throw ex;
                return(false);
            }
            finally
            {
                exec = null;
            }
        }
コード例 #2
0
        // 公用静态方法,删除一条记录 DeleteProvince
        public static bool DeleteEntity(ProvinceBusEntity obj)
        {
            if (obj == null || obj.IsEmpty)
            {
                return(false);
            }
            ProvinceDelete exec = new ProvinceDelete();

            try
            {
                exec.ReceiveParameter(obj);
                exec.ExecNoQuery();
                return(true);
            }
            catch (Exception ex)
            {
                //throw ex;
                return(false);
            }
            finally
            {
                obj = null;
            }
        }