Пример #1
0
        private bool GetRecordId()
        {
            bool idIsSelected = false;
            int companyId = Int32.Parse(Session["companyID"].ToString());
            JlinerAddMasterArea jlinerAddMasterArea = new JlinerAddMasterArea(jlinerAddTDS);

            // Update rows
            foreach (GridViewRow row in grdSection.Rows)
            {
                Guid id = new Guid(((Label)row.FindControl("lblID")).Text);
                string recordId = ((Label)row.FindControl("lblRecordId")).Text;
                bool selected = ((CheckBox)row.FindControl("cbxSelected")).Checked;
                string street = ((Label)row.FindControl("lblStreetGrid")).Text;
                string actualLength = ((Label)row.FindControl("lblActualLengthGrid")).Text;
                string usmh = ((Label)row.FindControl("lblUsmh")).Text;
                string dsmh = ((Label)row.FindControl("lblDsmh")).Text;

                jlinerAddMasterArea.Update(id, companyId, selected);

                // ... Save selected project
                if (selected)
                {
                    hdfRecordId.Value = recordId;
                    hdfSelectedId.Value = id.ToString();
                    hdfStreet.Value = street;
                    hdfActualLength.Value = actualLength;
                    hdfUsmh.Value = usmh;
                    hdfDsmh.Value = dsmh;
                    idIsSelected = true;
                }
            }

            return idIsSelected;
        }