Ejemplo n.º 1
0
        public int Update(List <RoleTaskPermDC> objRoleTaskPerms)
        {
            int            updatedCount      = 0;
            DBConnection   objConnection     = new DBConnection();
            RoleTaskPermDA objRoleTaskPermDA = new RoleTaskPermDA();

            try
            {
                objConnection.Open(true);
                updatedCount = objRoleTaskPermDA.Update(objConnection, objRoleTaskPerms);
                IsDirty      = objRoleTaskPermDA.IsDirty;
                if (IsDirty)
                {
                    objConnection.Rollback();
                }
                else
                {
                    objConnection.Commit();
                }
            }
            catch (Exception ex)
            {
                objConnection.Rollback();
                throw ex;
            }
            finally
            {
                objConnection.Close();
            }
            return(updatedCount);
        }
Ejemplo n.º 2
0
        public RoleTaskPermDC LoadByPrimaryKey(string RoleID, string TaskID)
        {
            DBConnection   objConnection     = new DBConnection();
            RoleTaskPermDA objRoleTaskPermDA = new RoleTaskPermDA();
            RoleTaskPermDC objRoleTaskPermDC = null;

            try
            {
                objConnection.Open(false);
                objRoleTaskPermDC = objRoleTaskPermDA.LoadByPrimaryKey(objConnection, RoleID, TaskID);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                objConnection.Close();
            }
            return(objRoleTaskPermDC);
        }
Ejemplo n.º 3
0
        public List <RoleTaskPermDC> LoadAll()
        {
            DBConnection          objConnection     = new DBConnection();
            RoleTaskPermDA        objRoleTaskPermDA = new RoleTaskPermDA();
            List <RoleTaskPermDC> objRoleTaskPermDC = null;

            try
            {
                objConnection.Open(false);
                objRoleTaskPermDC = objRoleTaskPermDA.LoadAll(objConnection);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                objConnection.Close();
            }
            return(objRoleTaskPermDC);
        }
Ejemplo n.º 4
0
        public int Insert(List <RoleTaskPermDC> objRoleTaskPerms)
        {
            int            insertedCount     = 0;
            DBConnection   objConnection     = new DBConnection();
            RoleTaskPermDA objRoleTaskPermDA = new RoleTaskPermDA();

            try
            {
                objConnection.Open(true);
                insertedCount = objRoleTaskPermDA.Insert(objConnection, objRoleTaskPerms);
                objConnection.Commit();
            }
            catch (Exception ex)
            {
                objConnection.Rollback();
                throw ex;
            }
            finally
            {
                objConnection.Close();
            }
            return(insertedCount);
        }