Exemplo n.º 1
0
        protected void GridView_OnSelectedIndexChanged(object sender, EventArgs e)
        {
            RoomObjectDataSourceOneRow.SelectParameters["ID_Room"].DefaultValue = RoomGridView.SelectedValue.ToString();
            UpdatePan.DataBind();
            TextBox2.Text              = UpdatePan.Rows[1].Cells[1].Text;
            TextBoxNum.Text            = UpdatePan.Rows[2].Cells[1].Text;
            OtdelenList.SelectedValue  = UpdatePan.Rows[3].Cells[1].Text;
            BuildingList.SelectedValue = UpdatePan.Rows[4].Cells[1].Text;

            RoomDeviceListDataSource.SelectMethod = "GetOneRecordTest";
            RoomDeviceListDataSource.SelectParameters.Clear();
            RoomDeviceListDataSource.SelectParameters.Add("ID_Room", RoomGridView.SelectedValue.ToString());
            RoomDeviceListDataSource.SelectParameters.Add("ID_Unit", "0");

            Load_Image();
            ImageChecked.DataBind();
            string photoFilePath = Server.MapPath("../Image_Data/");

            for (int i = 0; i < CheckBoxImage.Items.Count; i++)
            {
                if (!File.Exists(photoFilePath + CheckBoxImage.DataKeys[i].Values[2].ToString() + "_" + CheckBoxImage.DataKeys[i].Values[1].ToString() + "." + CheckBoxImage.DataKeys[i].Values[3].ToString()))
                {
                    ImageFilesObjectDataSource.SelectMethod = "TestGetSqlBytes";
                    ImageFilesObjectDataSource.SelectParameters.Clear();
                    ImageFilesObjectDataSource.SelectParameters.Add("documentID", CheckBoxImage.DataKeys[i].Values[1].ToString());
                    ImageFilesObjectDataSource.SelectParameters.Add("filePath", photoFilePath);
                    ImageFilesObjectDataSource.Select();
                }
            }

            // начало рисунков к чекбоксу

/*
 *          try
 *          {
 *              foreach (ListItem item in CheckBoxImage1.Items)
 *              {
 *                  item.Text = string.Format("<img width=20px src = \"{0}\" /> {1} , {2}", this.GetImageUrl(), item.Text, item.Value);
 *              }
 *          }
 *          catch (Exception ex)
 *          {
 *              this.Msg.Text = ex.ToString();
 *          }
 */
            // конец рисунков к чекбоксу

            ModalPopupExtender1.Show();
            UpdateButton.Visible = true;
            InsertButton.Visible = false;
            DeleteButton.Visible = true;
            AddImge.Visible      = true;
        }
Exemplo n.º 2
0
 protected void GridView_OnSelectedIndexChanged(object sender, EventArgs e)
 {
     UpdatePan.DataBind();
     TextBox2.Text = OtdelenGridView.DataKeys[OtdelenGridView.SelectedIndex].Values[2].ToString();              //UpdatePan.Rows[1].Cells[1].Text;
     BuildingList.SelectedValue = OtdelenGridView.DataKeys[OtdelenGridView.SelectedIndex].Values[1].ToString(); //UpdatePan.Rows[2].Cells[1].Text;
     Floor.Text = OtdelenGridView.DataKeys[OtdelenGridView.SelectedIndex].Values[3].ToString();                 //UpdatePan.Rows[3].Cells[1].Text;
     ModalPopupExtender1.Show();
     Load_Image();
     AddImge.Visible      = true;
     UpdateButton.Visible = true;
     InsertButton.Visible = false;
     DeleteButton.Visible = true;
 }
Exemplo n.º 3
0
 protected void GridView_OnSelectedIndexChanged(object sender, EventArgs e)
 {
     UpdatePan.DataBind();
     TextBox2.Text = UpdatePan.Rows[1].Cells[1].Text;
     try
     {
         int VUnit;
         VUnit = Convert.ToInt16(UpdatePan.Rows[2].Cells[1].Text);
         RadioButtonUnit.SelectedValue = UpdatePan.Rows[2].Cells[1].Text;
     }
     catch (FormatException)
     {
         Msg.Text = "Поле подразделение ранее было пустым";
     }
     Load_Image();
     ModalPopupExtender1.Show();
     UpdateButton.Visible = true;
     InsertButton.Visible = false;
     DeleteButton.Visible = true;
     AddImge.Visible      = true;
 }