示例#1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Griddata.DataSource = GridView.Entities.Users.GetUsers();
         Griddata.DataBind();
     }
 }
示例#2
0
        protected void Adduser_Click(object sender, EventArgs e)
        {
            var dataSource = GridView.Entities.Users.GetUsers();

            dataSource.Add(new Users
            {
                Name     = Namebox.Text,
                UserName = Usernamebox.Text,
                Email    = Emailbox.Text,
                Password = Usernamebox.Text
            });

            Griddata.DataSource = dataSource;
            Griddata.DataBind();
            Griddata.Visible = true;
        }
示例#3
0
	public void blockAllocatorInitialization(){
		gridmap = grid.GetComponent<Griddrawing>();
		griddata = grid.GetComponent<Griddata>();
		griddata.setIntensityAndIncline();
		ysize = gridmap.verticalgridnum;
		xsize = gridmap.horizongridnum;
		maxsize = gridmap.maxgridnum;

		for (int y = 0 ; y < ysize ; y ++){
			for (int x = 0 ; x < xsize ; x ++){
				float textureScaling = 0.1f + (0.9f * (griddata.intensity[x,y] / 100.0f));
				blocks.transform.GetChild((y*xsize)+x).position = new Vector3(((float)maxsize / xsize) * x,((float)maxsize / ysize) * y,0.0f);
				blocks.transform.GetChild((y*xsize)+x).localScale = new Vector3(5.0f / xsize, 5.0f / ysize,1.0f);
				blockcolor = new Color(textureScaling,textureScaling,textureScaling,textureScaling) ;
				blocks.transform.GetChild((y*xsize)+x).GetComponent<SpriteRenderer>().color = blockcolor;
			}
		}
	}