private void EditAdviserData() { try { LoadDropDownList(); GridViewRow oGridViewRow = gvAdviser.Rows[Convert.ToInt32(ViewState["index"])]; Label lblAdviserId = (Label)oGridViewRow.FindControl("lblAdviserId"); Session["AdviserId"] = lblAdviserId.Text; AdviserDTO oAdviserDTO = new AdviserDTO(); oAdviserDTO = oWebApiCalls.AdviserSearchById(Convert.ToInt32(lblAdviserId.Text)); txtName.Text = oAdviserDTO.Name; txtAddress.Text = oAdviserDTO.Address; txtTelephone.Text = oAdviserDTO.Telephone; txtEmail.Text = oAdviserDTO.Email; txtDescription.InnerText = oAdviserDTO.Description; ddlType.SelectedValue = Convert.ToString((int)oAdviserDTO.Type); txtJoinDate.Text = oAdviserDTO.JoinDate.ToString("yyyy-MM-dd"); //txtNoOfShares.Text = Convert.ToString(oAdviserDTO.NumberOfShares); //txtSharePrice.Text = Convert.ToString(oAdviserDTO.SharePrice); ddlStatus.SelectedValue = Convert.ToString((int)oAdviserDTO.Status); string DecryptedPwd = Cryptography.Encryption.Decrypt(oAdviserDTO.Password, oAdviserDTO.UserName); txtUserName.Text = oAdviserDTO.UserName; txtPassword.Text = DecryptedPwd; ControllersHandler(CommandMood.Edit); } catch (Exception ex) { lblError.Text = ex.Message.ToString(); throw ex; } }