Ejemplo n.º 1
0
        public List <userrolesmapping> userrolesmappingGetAll()
        {
            List <userrolesmapping> lstuserrolesmapping = new List <userrolesmapping>();

            try
            {
                DataTable dt = SqlHelper.ExecuteDataset(SqlImplHelper.getConnectionString(), "userrolesmappingGetAll").Tables[0];
                if (dt.Rows.Count > 0)
                {
                    int colUserRoleId  = dt.Columns["UserRoleId"].Ordinal;
                    int colUserGroupId = dt.Columns["UserGroupId"].Ordinal;
                    for (int i = 0; dt.Rows.Count > i; i++)
                    {
                        userrolesmapping NewEnt = new userrolesmapping();
                        NewEnt.UserRoleId  = Int32.Parse(dt.Rows[i].ItemArray[colUserRoleId].ToString());
                        NewEnt.UserGroupId = Int32.Parse(dt.Rows[i].ItemArray[colUserGroupId].ToString());
                        lstuserrolesmapping.Add(NewEnt);
                    }
                }
                return(lstuserrolesmapping);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 public List<userrolesmapping> userrolesmappingGetAll()
 {
     List<userrolesmapping> lstuserrolesmapping = new List<userrolesmapping>();
     try
     {
         DataTable dt = SqlHelper.ExecuteDataset(SqlImplHelper.getConnectionString(), "userrolesmappingGetAll").Tables[0];
         if (dt.Rows.Count > 0)
         {
             int colUserRoleId =  dt.Columns["UserRoleId"].Ordinal;
             int colUserGroupId =  dt.Columns["UserGroupId"].Ordinal;
             for (int i = 0; dt.Rows.Count > i; i++)
             {
                 userrolesmapping NewEnt = new userrolesmapping();
                 NewEnt.UserRoleId = Int32.Parse(dt.Rows[i].ItemArray[colUserRoleId].ToString());
                 NewEnt.UserGroupId = Int32.Parse(dt.Rows[i].ItemArray[colUserGroupId].ToString());
                 lstuserrolesmapping.Add(NewEnt);
             }
         }
         return lstuserrolesmapping;
     }
     catch(Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 3
0
 public int userrolesmappingAdd(userrolesmapping userrolesmapping)
 {
     try
     {
         return((int)SqlHelper.ExecuteScalar(SqlImplHelper.getConnectionString(), "userrolesmappingAdd",
                                             userrolesmapping.UserRoleId,
                                             userrolesmapping.UserGroupId));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public int userrolesmappingAdd( userrolesmapping userrolesmapping)
 {
     try
     {
         return (int)SqlHelper.ExecuteScalar(SqlImplHelper.getConnectionString(), "userrolesmappingAdd",
                                                                                     userrolesmapping.UserRoleId,
                                                                                     userrolesmapping.UserGroupId);
     }
     catch(Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 5
0
        public userrolesmapping userrolesmappingGetById(int UserRoleId, int UserGroupId)
        {
            try
            {
                DataTable dt = SqlHelper.ExecuteDataset(SqlImplHelper.getConnectionString(), "userrolesmappingGetById",
                                                        UserRoleId, UserGroupId).Tables[0];
                userrolesmapping NewEnt = new userrolesmapping();

                if (dt.Rows.Count > 0)
                {
                    DataRow dr = dt.Rows[0];
                    NewEnt.UserRoleId  = Int32.Parse(dr["UserRoleId"].ToString());
                    NewEnt.UserGroupId = Int32.Parse(dr["UserGroupId"].ToString());
                }
                return(NewEnt);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 6
0
 public bool userrolesmappingUpdate(userrolesmapping userrolesmapping)
 {
     try
     {
         int update = SqlHelper.ExecuteNonQuery(SqlImplHelper.getConnectionString(), "userrolesmappingUpdate",
                                                userrolesmapping.UserRoleId,
                                                userrolesmapping.UserGroupId);
         if (update > 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        public userrolesmapping userrolesmappingGetById(int UserRoleId, int UserGroupId)
        {
            try
            {
                DataTable dt = SqlHelper.ExecuteDataset(SqlImplHelper.getConnectionString(), "userrolesmappingGetById",
                                                                                                UserRoleId, UserGroupId).Tables[0];
                userrolesmapping NewEnt = new userrolesmapping();

                if(dt.Rows.Count > 0)
                {
                    DataRow dr = dt.Rows[0];
                    NewEnt.UserRoleId = Int32.Parse(dr["UserRoleId"].ToString());
                    NewEnt.UserGroupId = Int32.Parse(dr["UserGroupId"].ToString());
                }
                return NewEnt;
            }
            catch(Exception ex)
            {
                throw ex;
            }
        }
        public bool userrolesmappingUpdate(userrolesmapping userrolesmapping)
        {
            userrolesmappingImpl ouserrolesmappingImpl = new userrolesmappingImpl();

            return(ouserrolesmappingImpl.userrolesmappingUpdate(userrolesmapping));
        }
        public int userrolesmappingAdd(userrolesmapping userrolesmapping)
        {
            userrolesmappingImpl ouserrolesmappingImpl = new userrolesmappingImpl();

            return(ouserrolesmappingImpl.userrolesmappingAdd(userrolesmapping));
        }
 public bool userrolesmappingUpdate(userrolesmapping userrolesmapping)
 {
     userrolesmappingImpl ouserrolesmappingImpl = new userrolesmappingImpl();
     return ouserrolesmappingImpl.userrolesmappingUpdate( userrolesmapping);
 }
 public int userrolesmappingAdd(userrolesmapping userrolesmapping)
 {
     userrolesmappingImpl ouserrolesmappingImpl = new userrolesmappingImpl();
     return ouserrolesmappingImpl.userrolesmappingAdd( userrolesmapping);
 }
 public bool userrolesmappingUpdate( userrolesmapping userrolesmapping)
 {
     try
     {
         int update = SqlHelper.ExecuteNonQuery(SqlImplHelper.getConnectionString(), "userrolesmappingUpdate",
                                                                                     userrolesmapping.UserRoleId,
                                                                                     userrolesmapping.UserGroupId);
         if (update > 0)
         {
             return true;
         }
         else
         {
             return false;
         }
     }
     catch(Exception ex)
     {
         throw ex;
     }
 }