Esempio n. 1
0
        private static CBE.RoleModuleRightCollection ConvertDataTableToCollection(DataTable dt)
        {
            try
            {
                CBE.RoleModuleRightCollection roleModuleRights = new CBE.RoleModuleRightCollection();

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    CBE.RoleModuleRightCBE roleModuleRight = new CBE.RoleModuleRightCBE();

                    if (dt.Rows[i]["ROLE_ID"] != DBNull.Value)
                    {
                        roleModuleRight.RoleId = Convert.ToInt32(dt.Rows[i]["ROLE_ID"]);
                    }



                    if (dt.Rows[i]["MODULE_ACTIVITY_ENTRY_ID"] != DBNull.Value)
                    {
                        roleModuleRight.ModuleActivityEntryId = Convert.ToInt32(dt.Rows[i]["MODULE_ACTIVITY_ENTRY_ID"]);
                    }

                    if (dt.Rows[i]["TRANSFER_STATUS"] != DBNull.Value)
                    {
                        roleModuleRight.TransferStatus = Convert.ToInt32(dt.Rows[i]["TRANSFER_STATUS"]);
                    }

                    roleModuleRights.Add(roleModuleRight);
                }
                return(roleModuleRights);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }