private void LoadData() { LoadComboBox(); LoadAllchkList(); if (_mode == "New") { // Additional logic here. this.Text = "Nuevo Usuario Externo"; txtName.Select(); } else if (_mode == "Edit") { // Setear lenght dimamicos de numero de documento SetLenght(ddlDocType.SelectedValue.ToString()); OperationResult objCommonOperationResultedit = new OperationResult(); objPerson = _objPacientBL.GetPerson(ref objCommonOperationResultedit, _personId); this.Text = this.Text + " (" + objPerson.v_FirstName + " " + objPerson.v_FirstLastName + " " + objPerson.v_SecondLastName + ")"; // Informacion de la persona txtName.Text = objPerson.v_FirstName; txtFirstLastName.Text = objPerson.v_FirstLastName; txtSecondLastName.Text = objPerson.v_SecondLastName; txtDocNumber.Text = objPerson.v_DocNumber; dtpBirthdate.Value = objPerson.d_Birthdate.Value; txtBirthPlace.Text = objPerson.v_BirthPlace; ddlMaritalStatus.SelectedValue = objPerson.i_MaritalStatusId.ToString(); ddlLevelOfId.SelectedValue = objPerson.i_LevelOfId.ToString(); ddlDocType.SelectedValue = objPerson.i_DocTypeId.ToString(); txtDocNumber.Text = objPerson.v_DocNumber; ddlSexType.SelectedValue = objPerson.i_SexTypeId.ToString(); txtTelephoneNumber.Text = objPerson.v_TelephoneNumber; txtAdressLocation.Text = objPerson.v_AdressLocation; txtMail.Text = objPerson.v_Mail; // Informacion de Profesional OperationResult objCommonOperationResult1 = new OperationResult(); var objProfessional = _objPacientBL.GetProfessional(ref objCommonOperationResult1, _personId); if (objProfessional != null) { ComboTreeNode nodoABuscar = ddlProfession.AllNodes.First(x => x.Tag.ToString() == objProfessional.i_ProfessionId.ToString()); ddlProfession.SelectedNode = nodoABuscar; txtProfessionalCode.Text = objProfessional.v_ProfessionalCode; txtProfessionalInformation.Text = objProfessional.v_ProfessionalInformation; } // Informacion del usuario OperationResult objOperationResult = new OperationResult(); _objSystemUserTemp = _objSecurityBL.GetSystemUser(ref objOperationResult, _systemUserId.Value); txtUserName.Text = _objSystemUserTemp.v_UserName; txtPassword1.Text = _objSystemUserTemp.v_Password; txtPassword2.Text = _objSystemUserTemp.v_Password; if (_objSystemUserTemp.d_ExpireDate != null) { rbFEchaExpiracion.Checked = true; dtpExpiredDate.Value = _objSystemUserTemp.d_ExpireDate.Value; } else { rbNuncaCaduca.Checked = true; dtpExpiredDate.Enabled = false; } LoadchkListByProtocolIdAndSystemUserId(); } }
private void LoadData() { string Mode = Request.QueryString["Mode"].ToString(); int systemUserId = -1; string personId = string.Empty; LoadComboBox(); if (Mode == "New") { // Additional logic here. txtFirstName.Focus(true); } else if (Mode == "Edit") { if (Request.QueryString["systemUserId"] != null) { systemUserId = int.Parse(Request.QueryString["systemUserId"].ToString()); } if (Request.QueryString["personId"] != null) { personId = Request.QueryString["personId"].ToString(); } OperationResult objCommonOperationResultedit = new OperationResult(); personDto personDTO = _objPacientBL.GetPerson(ref objCommonOperationResultedit, personId); Session["objEntity"] = personDTO; // Informacion de la persona txtFirstName.Text = personDTO.v_FirstName; txtFirstLastName.Text = personDTO.v_FirstLastName; txtSecondLastName.Text = personDTO.v_SecondLastName; txtDocNumber.Text = personDTO.v_DocNumber; dpBirthdate.SelectedDate = personDTO.d_Birthdate; txtBirthPlace.Text = personDTO.v_BirthPlace; ddlMaritalStatus.SelectedValue = personDTO.i_MaritalStatusId.ToString(); ddlLevelOfId.SelectedValue = personDTO.i_LevelOfId.ToString(); ddlDocType.SelectedValue = personDTO.i_DocTypeId.ToString(); ddlSexType.SelectedValue = personDTO.i_SexTypeId.ToString(); txtTelephoneNumber.Text = personDTO.v_TelephoneNumber; txtAdressLocation.Text = personDTO.v_AdressLocation; txtMail.Text = personDTO.v_Mail; // Setear lenght dimamicos de numero de documento SetLenght(ddlDocType.SelectedValue); // Informacion de Profesional OperationResult objCommonOperationResult1 = new OperationResult(); var objProfessional = _objPacientBL.GetProfessional(ref objCommonOperationResult1, personId); if (objProfessional != null) { ddlProfession.SelectedValue = objProfessional.i_ProfessionId.ToString(); txtProfessionalCode.Text = objProfessional.v_ProfessionalCode; txtProfessionalInformation.Text = objProfessional.v_ProfessionalInformation; ImgPhoto.ImageUrl = null; if (objProfessional.b_SignatureImage != null) { string pathImage = byteArrayToImage(objProfessional.b_SignatureImage); string str = @"~\Utils\GetImageText.ashx?" + getParameterRequest("imgDeliverValid", "180", "", "Arial Black", "Black", "9", "30", "20", ""); ImgPhoto.ImageUrl = str; } } else { objProfessional = new professionalDto(); } Session["objProfessional"] = objProfessional; // Informacion del usuario OperationResult objOperationResult = new OperationResult(); systemuserDto objSystemUser = _objSecurityBL.GetSystemUser(ref objOperationResult, systemUserId); Session["objSystemUser"] = objSystemUser; txtUserName.Text = objSystemUser.v_UserName; txtPassword1.Text = objSystemUser.v_Password; txtPassword2.Text = objSystemUser.v_Password; ddlRolVenta.SelectedValue = objSystemUser.i_RolVentaId.ToString(); } }