示例#1
0
        public bool RemoveRelGroupInfo(int comp_id, string rel_grp_id)
        {
            int affectedRow = 0;

            IDbConnection conn = DbAgentHelper.CreateDbConnection();

            conn.Open();
            IDbTransaction trx = conn.BeginTransaction();

            try
            {
                affectedRow = _relGroupInfo.Delete(conn
                                                   , trx
                                                   , comp_id
                                                   , rel_grp_id);


                Dac_RelGroupDepts dacDept = new Dac_RelGroupDepts();
                dacDept.Delete(conn
                               , trx
                               , comp_id
                               , rel_grp_id
                               , 0
                               , ""
                               , 0);

                Dac_RelGroupPositionInfos dacInfos = new Dac_RelGroupPositionInfos();
                dacInfos.Delete(conn
                                , trx
                                , comp_id
                                , ""
                                , rel_grp_id);

                Dac_RelGroupPositionDatas dacDatas = new Dac_RelGroupPositionDatas();
                dacDatas.Delete(conn
                                , trx
                                , comp_id
                                , ""
                                , rel_grp_id);


                trx.Commit();
            }
            catch (Exception ex)
            {
                trx.Rollback();
                return(false);
            }
            finally
            {
                conn.Close();
            }

            return((affectedRow > 0) ? true : false);
        }