Ejemplo n.º 1
0
        private void EditPlayerData()
        {
            try
            {
                LoadDropDownList();
                GridViewRow oGridViewRow = gvPlayer.Rows[Convert.ToInt32(ViewState["index"])];
                Label       lblPlayerId  = (Label)oGridViewRow.FindControl("lblPlayerId");
                Session["PlayerId"] = lblPlayerId.Text;
                PlayerDTO oPlayerDTO = new PlayerDTO();
                oPlayerDTO = oWebApiCalls.PlayerSearchById(Convert.ToInt32(lblPlayerId.Text));

                txtName.Text             = oPlayerDTO.Name;
                txtAddress.Text          = oPlayerDTO.Address;
                txtTelephone.Text        = oPlayerDTO.Telephone;
                txtEmail.Text            = oPlayerDTO.Email;
                txtDescription.InnerText = oPlayerDTO.Description;
                ddlType.SelectedValue    = Convert.ToString((int)oPlayerDTO.Type);
                txtJoinDate.Text         = oPlayerDTO.JoinDate.ToString("yyyy-MM-dd");
                //txtNoOfShares.Text = Convert.ToString(oPlayerDTO.NumberOfShares);
                //txtSharePrice.Text = Convert.ToString(oPlayerDTO.SharePrice);
                ddlStatus.SelectedValue = Convert.ToString((int)oPlayerDTO.Status);

                string DecryptedPwd = Cryptography.Encryption.Decrypt(oPlayerDTO.Password, oPlayerDTO.UserName);

                txtUserName.Text = oPlayerDTO.UserName;
                txtPassword.Text = DecryptedPwd;

                ControllersHandler(CommandMood.Edit);
            }
            catch (Exception ex)
            {
                lblError.Text = ex.Message.ToString();
                throw ex;
            }
        }