protected void ResetForm() { LoadSite(CurrentSiteId); LoadSiteLocation(CurrentSiteId); LoadUserGroup(CurrentSiteId); LoadUserPosition(0); LoadSupervisor(); tbUserID.Text = ""; tbPassWord.Text = ""; tbFName.Text = ""; tbMName.Text = ""; tbLName.Text = ""; tbSIN.Text = ""; tbDOB.SelectedDate = null; tbAge.Text = ""; ddlMarital.SelectedValue = ""; ddlGender.SelectedValue = ""; tbWEmail.Text = ""; tbWPhone.Text = ""; RadComboBoxSite.SelectedValue = CurrentSiteId.ToString(); RadComboBoxSiteLocation.SelectedValue = CurrentSiteLocationId.ToString(); RadComboBoxUserGroup.SelectedValue = ""; RadComboBoxUserPosition.SelectedValue = ""; RadComboBoxSuper.SelectedValue = ""; tbEmpNo.Text = ""; cbActive.Checked = true; tbPAddess1.Text = ""; tbPAddess2.Text = ""; tbPCity.Text = ""; tbPProvince.Text = ""; tbPPostal.Text = ""; tbPHomePhone.Text = ""; tbPCell.Text = ""; tbPEmail.Text = ""; tbEName.Text = ""; tbERelation.Text = ""; tbEPhone.Text = ""; tbEAddress.Text = ""; tbUserID.Enabled = true; RadComboBoxSite.Enabled = true; RadComboBoxSiteLocation.Enabled = true; tbEmpNo.Enabled = true; RadBinaryImagePicture.DataValue = null; RadBinaryImagePicture.Visible = false; if (RadToolBarUser.FindItemByText("New") != null) { RadToolBarUser.FindItemByText("New").Enabled = false; } if (RadToolBarUser.FindItemByText("Update") != null) { RadToolBarUser.FindItemByText("Update").Text = @"Save"; } }
protected void LoadSite() { var global = new CGlobal(); RadComboBoxSite.Items.Clear(); RadComboBoxSite.Text = string.Empty; RadComboBoxSite.DataSource = global.GetSiteId(); RadComboBoxSite.DataTextField = "Name"; RadComboBoxSite.DataValueField = "Value"; RadComboBoxSite.DataBind(); foreach (RadComboBoxItem item in RadComboBoxSite.Items) { if (item.Value == CurrentSiteId.ToString()) { item.Selected = true; break; } } }