예제 #1
0
        protected void DroneBatteryReater_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            string cmdName = e.CommandName;
            string cmdArgu = e.CommandArgument.ToString();
            string Page    = Request.QueryString["Page"];

            if ("DeleteItem" == cmdName)
            {
                ConnectDB.DeleteUser(Convert.ToInt32(cmdArgu));
            }

            if ("UpDateItem" == cmdName)
            {
                string targetUrl = "~/Drone_UserList_Create.aspx?Sid=" + cmdArgu;

                Response.Redirect(targetUrl);
            }

            DataTable dt = ConnectDB.ReadDroneUserList();

            if (Page == null)
            {
                Page = "1";
            }

            ChangePage.TotalSize = dt.Rows.Count;
            int fistData = (Convert.ToInt32(Page) - 1) * 10 + 1;
            int LastData = Convert.ToInt32(Page) * 10;

            DataTable dt1 = ConnectDB.ReadTenDataDroneUserList(fistData, LastData);


            this.DroneUserListReater.DataSource = dt1;
            this.DroneUserListReater.DataBind();
        }