Ejemplo n.º 1
0
        /*
         * protected void EditIdButton_Click(object sender, EventArgs e)
         * {
         *  DeviceIdTextBox.Enabled = true;
         *  EditIdButton.Visible = false;
         * }
         */

        protected void SaveButton_Click(object sender, EventArgs e)
        {
            int userID = 0;

            Int32.TryParse(UserDropDown.SelectedValue, out userID);

            var device = new Device();

            device.Name = DeviceNameTextBox.Text;
            //device.Serial = SerialNumberTextBox.Text;
            device.UID   = DeviceIdTextBox.Text;
            device.Owner = Sprocs.GetDeviceOwner(OwnerDropDown.SelectedValue);
            device.User  = Sprocs.GetUserById(userID);

            Sprocs.CreateDevice(device);

            Response.Redirect("/");
        }