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


C# Car.getId方法代码示例

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


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

示例1: addNewTable

    private void addNewTable(Car car)
    {
        Table tbl = new Table();
        

        tbl.Width = new Unit("100%");
        tbl.Height = new Unit("100%");
        
        
        //------------------row-----------------------
        TableRow rw = new TableRow();
        //---------------------cell--------------
        TableCell cell = new TableCell();
        cell.Width = 300;
        
        LinkButton carTitle = new LinkButton();
        carTitle.Font.Size = 20;
        carTitle.Text = car.getCarBrand() + " " + car.getCarModel();
        carTitle.Click += new EventHandler(LinkButton1_Click);
        carTitle.ID = "Title" + car.getId().ToString();
        carTitle.CssClass = "linkbtn";
        cell.Controls.Add(carTitle);
        rw.Cells.Add(cell);

        //---------------------cell--------------
        cell = new TableCell();

        Panel div = new Panel();
        div.Style.Add("float", "right");

        Button btnEdit = new Button();
        btnEdit.Click += new EventHandler(btnAddFuel_Click);
        btnEdit.Text = "Редактирай";
        btnEdit.Style.Add("margin-left", "15px");
        btnEdit.Style.Add("margin-right", "15px");
        btnEdit.ID = "Edit" + car.getId().ToString();
        btnEdit.CssClass = "btn";

        div.Controls.Add(btnEdit);
        
        cell.Controls.Add(div);
        rw.Cells.Add(cell);

        //---------------------cell--------------
        cell = new TableCell();

        Panel div2 = new Panel();
        div.Style.Add("float", "left");

        Button btnDel = new Button();
        btnDel.Click += new EventHandler(btnDel_Click);
        btnDel.Text = "Изтрий";
        btnDel.Style.Add("margin-left", "15px");
        btnDel.Style.Add("margin-right", "15px");
        btnDel.ID = "Delete" + car.getId().ToString();
        btnDel.CssClass = "btn";

        div2.Controls.Add(btnDel);

        cell.Controls.Add(div2);
        rw.Cells.Add(cell);

        tbl.Controls.Add(rw);


        //------------------row-----------------------
        rw = new TableRow();

        //---------------------cell--------------
        cell = new TableCell();
        cell.RowSpan = 5;
        cell.Width = 300;

        ImageButton img = new ImageButton();
        img.ImageUrl = car.getCarImage();
        img.Width = 300;
        img.Height = 150;
        img.Style.Add("min-height", "150px");
        img.Style.Add("min-width", "100px");
        img.ID = "Img" + car.getId().ToString();
        img.ToolTip = "Виж история на автомобила";
        img.Click += new ImageClickEventHandler(img_Click);
        cell.Controls.Add(img);
        rw.Cells.Add(cell);

        //---------------------cell--------------
        cell = new TableCell();
        cell.ColumnSpan = 2;
        cell.Style.Add("height", "10px");

        Label carInfo = new Label();
        carInfo.Font.Size = 10;
        carInfo.Text = car.getCarFuel() + ", " + car.getCarEngine() + ", " + car.getCarHPowers() + " к.с., " + car.getCarYear();

        cell.Controls.Add(carInfo);
        rw.Cells.Add(cell);

        //---------------------cell--------------
        cell = new TableCell();
        cell.ColumnSpan = 4;
//.........这里部分代码省略.........
开发者ID:rgg1992,项目名称:Test,代码行数:101,代码来源:CarProfile.aspx.cs


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