Esempio n. 1
0
        private void EditBrokerData()
        {
            try
            {
                LoadDropDownList();
                GridViewRow oGridViewRow = gvBroker.Rows[Convert.ToInt32(ViewState["index"])];
                Label       lblBrokerId  = (Label)oGridViewRow.FindControl("lblBrokerId");
                Session["BrokerId"] = lblBrokerId.Text;
                BrokerDTO oBrokerDTO = new BrokerDTO();
                oBrokerDTO = oWebApiCalls.BrokerSearchById(Convert.ToInt32(lblBrokerId.Text));

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

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

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

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