protected void GridView4_RowCommand(object sender, GridViewCommandEventArgs e) { int ID_class = 0; //if (Session["ID_class"] ==null) //{ ID_class = Convert.ToInt32(e.CommandArgument); ID_class = ID_class % GridView4.PageSize; //} //else //{ // ID_class = int.Parse(Session["ID_class"].ToString()); //} string database = Session["DatabaseName"].ToString(); if (e.CommandName == "select") { Pnl_Edit.Visible = true; string UID = ((Label)GridView4.Rows[ID_class].FindControl("UID")).Text.Trim(); Session["UID"] = UID; string SQLselect = "Select * from FirmM where UID=" + UID; DataTable Dtvs = WebModel.LoadSetContentData(database, SQLselect); if (Dtvs != null && Dtvs.Rows.Count > 0) { foreach (DataRow row in Dtvs.Rows) { TBE_FirmName.Text = row["Name"].ToString(); TBE_SupportItem.Text = row["SupportItem"].ToString(); TBE_EIN.Text = row["EIN"].ToString(); TBE_Owner.Text = row["Owner"].ToString(); TBE_OwnerMobile.Text = row["OwnerMobile"].ToString(); TBE_Capital.Text = row["Capital"].ToString(); TBE_Staff.Text = row["StaffAmount"].ToString(); TBE_Tel1.Text = row["Tel1"].ToString(); TBE_Tel2.Text = row["Tel2"].ToString(); TBE_Fax1.Text = row["Fax1"].ToString(); TBE_Fax2.Text = row["Fax2"].ToString(); TBE_Email.Text = row["Email"].ToString(); TBE_CAddress.Text = row["ContectAddress"].ToString(); TBE_Notes.Text = row["Notes"].ToString(); TBE_RAddress.Text = row["RegisteredAddress"].ToString(); DDL_Select8.DataBind(); DDL_Select7.DataBind(); DDL_Select7.SelectedValue = row["Type"].ToString(); DDL_Select8.SelectedValue = row["Location"].ToString(); UID1.Text = row["UID"].ToString(); } } } }
protected void BtnReEdit_Click(object sender, EventArgs e) { Pnl_Edit.Visible = true; string database = Session["DatabaseName"].ToString(); if (Session["UID"] != null) { string SQLselect = "Select * from FirmM where UID=" + Session["UID"].ToString(); DataTable Dtvs = WebModel.LoadSetContentData(database, SQLselect); if (Dtvs != null && Dtvs.Rows.Count > 0) { foreach (DataRow row in Dtvs.Rows) { TBE_FirmName.Text = row["Name"].ToString(); TBE_SupportItem.Text = row["SupportItem"].ToString(); TBE_EIN.Text = row["EIN"].ToString(); TBE_Owner.Text = row["Owner"].ToString(); TBE_OwnerMobile.Text = row["OwnerMobile"].ToString(); TBE_Capital.Text = row["Capital"].ToString(); TBE_Staff.Text = row["StaffAmount"].ToString(); TBE_Tel1.Text = row["Tel1"].ToString(); TBE_Tel2.Text = row["Tel2"].ToString(); TBE_Fax1.Text = row["Fax1"].ToString(); TBE_Fax2.Text = row["Fax2"].ToString(); TBE_Email.Text = row["Email"].ToString(); TBE_CAddress.Text = row["ContectAddress"].ToString(); TBE_Notes.Text = row["Notes"].ToString(); TBE_RAddress.Text = row["RegisteredAddress"].ToString(); DDL_Select8.DataBind(); DDL_Select7.DataBind(); DDL_Select7.SelectedValue = row["Type"].ToString(); DDL_Select8.SelectedValue = row["Location"].ToString(); UID1.Text = row["UID"].ToString(); } } } }