当前位置: 首页>>代码示例>>C#>>正文


C# Group.Read方法代码示例

本文整理汇总了C#中Group.Read方法的典型用法代码示例。如果您正苦于以下问题:C# Group.Read方法的具体用法?C# Group.Read怎么用?C# Group.Read使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Group的用法示例。


在下文中一共展示了Group.Read方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: btnConfirm_Click

    protected void btnConfirm_Click(object sender, EventArgs e)
    {
        int groupID = Convert.ToInt32((string)(Session["groupID"]));
        int isUnicast = Convert.ToInt32(Session["isGroupUnicast"]);
        Group groupInfo = new Group();
        groupInfo.ID = groupID.ToString();
        groupInfo.Read(groupInfo);
        Image imageInfo = new Image();
        imageInfo.ID = imageInfo.GetImageID(groupInfo.Image);
        Session["imageID"] = imageInfo.ID;
        if (imageInfo.Check_Checksum(imageInfo.ID))
        {
            if (isUnicast == 1)
            {
                Unicast unicast = new Unicast();
                List<int> listHostID = new List<int>();
                listHostID = unicast.UnicastFromGroup(groupID);

                for (int z = 0; z < listHostID.Count; z++)
                    unicast.CreateUnicast("push", listHostID[z]);
                Utility.Message = "Started " + listHostID.Count + " Tasks";
            }
            else
            {
                Multicast multicast = new Multicast();
                multicast.CreateMulticast(groupID);
            }
            Session.Remove("groupID");
            Session.Remove("isGroupUnicast");
            Master.Msgbox(Utility.Message);
        }
        else
        {

            lblIncorrectChecksum.Text = "This Image Has Not Been Confirmed And Cannot Be Deployed.  <br>Confirm It Now?";
            ClientScript.RegisterStartupScript(this.GetType(), "modalscript", "$(function() {  var menuTop = document.getElementById('incorrectChecksum'),body = document.body;classie.toggle(menuTop, 'confirm-box-outer-open'); });", true);

        }
    }
开发者ID:cocoon,项目名称:crucibleWDS,代码行数:39,代码来源:groups.aspx.cs

示例2: TableForUser

    public DataTable TableForUser(string search)
    {
        Host host = new Host();
        WDSUser user = new WDSUser();
        user.ID = user.GetID(HttpContext.Current.User.Identity.Name);
        user = user.Read(user);
        DataTable table = new DataTable();

        if (!string.IsNullOrEmpty(user.GroupManagement))
        {
             List<string> listManagementGroups = user.GroupManagement.Split(' ').ToList<string>();

             foreach (string id in listManagementGroups)
             {
                  Group mgmtgroup = new Group();
                  mgmtgroup.ID = id;
                  mgmtgroup = mgmtgroup.Read(mgmtgroup);

                  table.Merge(host.SearchLimited(search, mgmtgroup.Name));
             }

             if (table.Rows.Count > 0)
             {
                  DataView dtview = new DataView(table);
                  dtview.Sort = "hostName asc";
                  table = dtview.ToTable();
             }
        }

        return table;
    }
开发者ID:cocoon,项目名称:crucibleWDS,代码行数:31,代码来源:Host.cs

示例3: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        group = new Group();
        requestedPage = Request.QueryString["page"] as string;
        group.ID = Request.QueryString["groupid"] as string;
        group.Read(group);

        if (!IsPostBack)
        {

            Master.Msgbox(Utility.Message);

            switch (requestedPage)
            {
                case "edit":
                    lblSubNav.Text = "| edit";
                    edit.Visible = true;
                    edit_page();
                    break;
                case "history":
                    lblSubNav.Text = "| history";
                    historypage.Visible = true;
                    history_page();
                    break;
                case "custombootmenu":
                    lblSubNav.Text = "| boot menu";
                    custombootmenu.Visible = true;
                    custombootmenu_page();
                    break;
                default:
                    break;
            }
        }
    }
开发者ID:cocoon,项目名称:crucibleWDS,代码行数:34,代码来源:view.aspx.cs

示例4: TableForUser

    public DataTable TableForUser(string search)
    {
        Group group = new Group();
        WDSUser user = new WDSUser();
        user.ID = user.GetID(HttpContext.Current.User.Identity.Name);
        user = user.Read(user);
        DataTable table = group.Search(search);

        if (!string.IsNullOrEmpty(user.GroupManagement))
        {
             List<string> listManagementGroups = user.GroupManagement.Split(' ').ToList<string>();

             List<string> groupNames = new List<string>();
             foreach (string id in listManagementGroups)
             {
                  group.ID = id;
                  group = group.Read(group);
                  groupNames.Add(group.Name);
             }
             foreach (DataRow row in table.Rows)
             {
                  if (!groupNames.Contains(row["groupname"].ToString()))
                       row.Delete();
             }
        }
        else
        {
             foreach (DataRow row in table.Rows)
             {
               row.Delete();
             }
        }

        return table;
    }
开发者ID:cocoon,项目名称:crucibleWDS,代码行数:35,代码来源:Group.cs

示例5: Delete

    public void Delete(List<int> listDelete)
    {
        try
        {
            using (NpgsqlConnection conn = new NpgsqlConnection(Utility.DBString))
            {
                conn.Open();
                for (int i = 0; i < listDelete.Count; i++)
                {
                    Group group = new Group();
                    group.ID = listDelete[i].ToString();
                    group = group.Read(group);

                    NpgsqlCommand cmd = new NpgsqlCommand("groups_delete", conn);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.Add(new NpgsqlParameter("@groupID", listDelete[i]));
                    cmd.ExecuteNonQuery();

                    History history = new History();
                    history.Event = "Delete";
                    history.Type = "Group";
                    history.TypeID = group.ID;
                    history.CreateEvent(history);
                }

                Utility.Message = "Successfully Deleted Group(s)";
            }
        }
        catch (Exception ex)
        {
            Utility.Message = "Could Not Delete Group(s).  Check The Exception Log For More Info";
            Logger.Log(ex.ToString());
        }
    }
开发者ID:cocoon,项目名称:crucibleWDS,代码行数:34,代码来源:Group.cs

示例6: edit_page

    protected void edit_page()
    {
        Master.Msgbox(Utility.Message);
        ddlHostImage.DataSource = Utility.PopulateImagesDdl();
        ddlHostImage.DataBind();
        ddlHostImage.Items.Insert(0, "Select Image");

        ddlHostGroup.DataSource = Utility.PopulateGroupsDdl();
        ddlHostGroup.DataBind();
        ddlHostGroup.Items.Insert(0, "");

        lbScripts.DataSource = Utility.GetScripts();
        lbScripts.DataBind();

        if (Master.IsInMembership("User"))
        {
            WDSUser user = new WDSUser();
            user.ID = user.GetID(HttpContext.Current.User.Identity.Name);
            user = user.Read(user);
            List<string> listManagementGroups = user.GroupManagement.Split(' ').ToList<string>();

            List<string> allowedGroups = new List<string>();

            foreach (string id in listManagementGroups)
            {
                Group mgmtgroup = new Group();
                mgmtgroup.ID = id;
                mgmtgroup = mgmtgroup.Read(mgmtgroup);

                foreach (ListItem item in ddlHostGroup.Items)
                {
                    if (item.Value == mgmtgroup.Name)
                        allowedGroups.Add(mgmtgroup.Name);
                }
            }

            bool isAuthorized = false;
            foreach (string aGroup in allowedGroups)
            {
                if (host.Group == aGroup)
                {
                    isAuthorized = true;
                    break;
                }
            }

            if (!isAuthorized)
                Response.Redirect("~/views/dashboard/dash.aspx?access=denied");

            ddlHostGroup.DataSource = allowedGroups;
            ddlHostGroup.DataBind();
            ddlHostGroup.Items.Insert(0, "");
        }

        ddlHostKernel.DataSource = Utility.GetKernels();
        ddlHostKernel.DataBind();
        ddlHostKernel.Items.Insert(0, "Select Kernel");

        ddlHostBootImage.DataSource = Utility.GetBootImages();
        ddlHostBootImage.DataBind();
        ddlHostBootImage.Items.Insert(0, "Select Boot Image");

        txtHostName.Text = host.Name;
        txtHostMac.Text = host.Mac;
        ddlHostImage.Text = host.Image;
        ddlHostGroup.Text = host.Group;
        txtHostDesc.Text = host.Description;
        ddlHostKernel.Text = host.Kernel;
        ddlHostBootImage.Text = host.BootImage;
        txtHostArguments.Text = host.Args;

        if (!string.IsNullOrEmpty(host.Scripts))
        {
            List<string> listhostScripts = host.Scripts.Split(',').ToList<string>();
            foreach (ListItem item in lbScripts.Items)
                foreach (var script in listhostScripts)
                    if (item.Value == script)
                        item.Selected = true;
        }
    }
开发者ID:cocoon,项目名称:crucibleWDS,代码行数:80,代码来源:view.aspx.cs


注:本文中的Group.Read方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。