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


C# Host.Read方法代码示例

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


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

示例1: 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++)
                {
                    Host host = new Host();
                    host.ID = listDelete[i].ToString();
                    host = host.Read(host);

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

                    History history = new History();
                    history.Event = "Delete";
                    history.Type = "Host";
                    history.Notes = host.Name;
                    history.TypeID = host.ID;
                    history.CreateEvent(history);
                }
                Utility.Message =  "Successfully Deleted Host(s)";

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

示例2: getHostName

 public void getHostName(string mac)
 {
     Host host = new Host();
     host.ID = host.GetHostID(mac);
     if (host.ID == "error")
     {
         HttpContext.Current.Response.Write("");
         return;
     }
     host.Read(host);
     HttpContext.Current.Response.Write(host.Name);
 }
开发者ID:cocoon,项目名称:crucibleWDS,代码行数:12,代码来源:ClientSvc.asmx.cs

示例3: btnSetBootMenu_Click

    protected void btnSetBootMenu_Click(object sender, EventArgs e)
    {
        foreach (string hostID in group.GetMemberIDs(group.Name))
        {
            Host host = new Host();
            host.ID = hostID;
            host = host.Read(host);
            host.SetCustomBootMenu(host, txtCustomBootMenu.Text);
        }

        History historyg = new History();
        historyg.Event = "Set Boot Menu";
        historyg.Type = "Group";
        historyg.TypeID = group.ID;
        historyg.CreateEvent(historyg);

        Master.Msgbox(Utility.Message);
    }
开发者ID:cocoon,项目名称:crucibleWDS,代码行数:18,代码来源:view.aspx.cs

示例4: Page_Load

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

        if (!IsPostBack)
        {
            Master.Msgbox(Utility.Message);

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


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