private void LoadData()
        {
            string Mode = Request.QueryString["Mode"].ToString();

            string personId = string.Empty;

            LoadComboBox();

            if (Mode == "New")
            {
                // Additional logic here.

                txtFirstName.Focus(true);
            }
            else if (Mode == "Edit")
            {
                if (Request.QueryString["v_PersonId"] != null)
                {
                    personId = Request.QueryString["v_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);



                ImgPhoto.ImageUrl = null;
                if (personDTO.b_PersonImage != null)
                {
                    string pathImage = byteArrayToImage(personDTO.b_PersonImage);
                    string str       = @"~\Utils\GetImageText.ashx?" + getParameterRequest("imgDeliverValid", "180", "", "Arial Black", "Black", "9", "30", "20", "");
                    ImgPhoto.ImageUrl = str;
                }
            }
        }
Пример #2
0
        private void frmCheckingFinger_Load(object sender, EventArgs e)
        {
            // Iniciar el componente huellero
            InitFingerPrint();
            FAutoIdentify = false;

            OperationResult objOperationResult = new OperationResult();

            var objPersonDto = objPacienteBL.GetPerson(ref objOperationResult, _PacientId);

            _personName       = objPersonDto.v_FirstName + " " + objPersonDto.v_FirstLastName + " " + objPersonDto.v_SecondLastName;
            _FingerPrintImage = objPersonDto.b_FingerPrintTemplate;
        }
        private bool Process(string personId, string protocolId)
        {
            try
            {
                var oprotocolDto = _protocolBl.GetProtocol(ref _operationResult, protocolId);
                var opersonDto   = _pacientBl.GetPerson(ref _operationResult, personId);

                _protocolDtos.Add(oprotocolDto);
                _personDtos.Add(opersonDto);

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
        private void btnSavePacient_Click(object sender, EventArgs e)
        {
            // Populate the entity

            var objpersonDto = new personDto();

            objpersonDto                   = _objPacientBL.GetPerson(ref objOperationResult, _PersonId);
            objpersonDto.v_PersonId        = _PersonId;
            objpersonDto.v_FirstName       = txtName.Text.Trim();
            objpersonDto.v_FirstLastName   = txtFirstLastName.Text.Trim();
            objpersonDto.v_SecondLastName  = txtSecondLastName.Text.Trim();
            objpersonDto.i_DocTypeId       = Convert.ToInt32(ddlDocTypeId.SelectedValue);
            objpersonDto.i_SexTypeId       = Convert.ToInt32(ddlSexTypeId.SelectedValue);
            objpersonDto.i_MaritalStatusId = Convert.ToInt32(ddlMaritalStatusId.SelectedValue);
            objpersonDto.i_LevelOfId       = Convert.ToInt32(ddlLevelOfId.SelectedValue);
            objpersonDto.v_DocNumber       = txtDocNumber.Text.Trim();
            objpersonDto.v_ComentaryUpdate = GetChangesPerson();
            objpersonDto.v_TelephoneNumber = txtTelephoneNumber.Text.Trim();

            objpersonDto.v_Mail = txtMail.Text.Trim();
            string Result = "";

            // Save the data
            Result = _objPacientBL.UpdatePacient(ref objOperationResult, objpersonDto, Globals.ClientSession.GetAsList(), NumberDocument, txtDocNumber.Text);

            //// Analizar el resultado de la operación
            if (objOperationResult.Success == 1)      // Operación sin error
            {
                MessageBox.Show("Se grabó correctamente.", "! INFORMACIÓN !", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            else      // Operación con error
            {
                if (Result == "-1")
                {
                    MessageBox.Show("El Número de documento ya existe.", "! ERROR !", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    MessageBox.Show(Constants.GenericErrorMessage, "! ERROR !", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    // Se queda en el formulario.
                }
            }
        }
Пример #5
0
        private void btnEditWorker_Click(object sender, EventArgs e)
        {
            var personDto = _pacientBl.GetPerson(ref _operationResult, _personId);

            personDto.i_DocTypeId         = int.Parse(cboDocumentType.SelectedValue.ToString());
            personDto.v_FirstName         = txtFirstName.Text;
            personDto.v_FirstLastName     = txtLastName.Text;
            personDto.v_SecondLastName    = txtSecondLastName.Text;
            personDto.d_Birthdate         = dtpDateTimeStar.Value;
            personDto.i_SexTypeId         = int.Parse(cboSexType.SelectedValue.ToString());
            personDto.v_CurrentOccupation = txtCurrentOcupation.Text;

            if (_pacientBl.UpdatePacient(ref _operationResult, personDto, Globals.ClientSession.GetAsList(), txtNroDocument.Text, txtNroDocument.Text) != "")
            {
                MessageBox.Show(@"Se actualizó los datos del trabajador", @"INFORMACIÓN", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show(@"Error al actualizar", @"ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #6
0
        private void grdDataCalendar_AfterSelectChange(object sender, Infragistics.Win.UltraWinGrid.AfterSelectChangeEventArgs e)
        {
            btnConsentimiento.Enabled = btnExportExcel.Enabled = btnExportPdf.Enabled = (grdDataCalendar.Selected.Rows.Count > 0);
            btnSendEmail.Enabled      = (grdDataCalendar.Selected.Rows.Count > 0 && _sendEmailEnabled);


            if (grdDataCalendar.Selected.Rows.Count != 0)
            {
                OperationResult             objOperationResult   = new OperationResult();
                ServiceBL                   objServiceBL         = new ServiceBL();
                PacientBL                   objPacientBL         = new PacientBL();
                personDto                   objpersonDto         = new personDto();
                List <ServiceComponentList> ListServiceComponent = new List <ServiceComponentList>();
                //string strServicelId = grdDataCalendar.Selected.Rows[0].Cells[5].Value.ToString();
                _strServicelId       = grdDataCalendar.Selected.Rows[0].Cells[5].Value.ToString();
                ListServiceComponent = objServiceBL.GetServiceComponents(ref objOperationResult, _strServicelId);
                grdDataServiceComponent.DataSource = ListServiceComponent;

                txtTrabajador.Text = grdDataCalendar.Selected.Rows[0].Cells["v_Pacient"].Value.ToString();
                _PacientId         = grdDataCalendar.Selected.Rows[0].Cells["v_PersonId"].Value.ToString();

                _serviceId = grdDataCalendar.Selected.Rows[0].Cells["v_ServiceId"].Value.ToString();

                _calendarId = grdDataCalendar.Selected.Rows[0].Cells["v_CalendarId"].Value.ToString();

                if (grdDataCalendar.Selected.Rows[0].Cells["v_WorkingOrganizationName"].Value != null)
                {
                    WorkingOrganization.Text = grdDataCalendar.Selected.Rows[0].Cells["v_WorkingOrganizationName"].Value.ToString();
                }

                txtProtocol.Text = grdDataCalendar.Selected.Rows[0].Cells["v_ProtocolName"].Value == null ? "" : grdDataCalendar.Selected.Rows[0].Cells["v_ProtocolName"].Value.ToString();
                txtService.Text  = grdDataCalendar.Selected.Rows[0].Cells["v_ServiceName"].Value.ToString();

                if (grdDataCalendar.Selected.Rows[0].Cells["v_ProtocolId"].Value != null)
                {
                    if (grdDataCalendar.Selected.Rows[0].Cells["v_ProtocolId"].Value.ToString() == Constants.CONSULTAMEDICA)
                    {
                        txtTypeESO.Text = "";
                    }
                    else
                    {
                        txtTypeESO.Text = grdDataCalendar.Selected.Rows[0].Cells["v_EsoTypeName"].Value.ToString();
                    }
                }

                objpersonDto = objPacientBL.GetPerson(ref objOperationResult, _PacientId);

                //Byte[] ooo = (byte[])grdDataCalendar.Selected.Rows[0].Cells["b_PersonImage"].Value;
                Byte[] ooo = objpersonDto.b_PersonImage;
                if (ooo == null)
                {
                    //pbImage.SizeMode = PictureBoxSizeMode.CenterImage;
                    pbImage.Image = Resources.nofoto;
                    _personImage  = null;
                }
                else
                {
                    //pbImage.SizeMode = PictureBoxSizeMode.Zoom;
                    pbImage.Image = Common.Utils.BytesArrayToImageOficce(ooo, pbImage);
                    _personImage  = ooo;
                }

                // Huella y Firma
                if (objpersonDto.b_FingerPrintImage == null)
                {
                    txtExisteHuella.Text      = "NO REGISTRADO";
                    txtExisteHuella.ForeColor = Color.Red;
                }
                else
                {
                    txtExisteHuella.Text      = "REGISTRADO";
                    txtExisteHuella.ForeColor = Color.DarkBlue;
                }

                // Firma
                if (objpersonDto.b_RubricImage == null)
                {
                    txtExisteFirma.Text      = "NO REGISTRADO";
                    txtExisteFirma.ForeColor = Color.Red;
                }
                else
                {
                    txtExisteFirma.Text      = "REGISTRADO";
                    txtExisteFirma.ForeColor = Color.DarkBlue;
                }
            }

            btnImprimirHojaRuta.Enabled = (grdDataServiceComponent.Rows.Count > 0);
        }
Пример #7
0
        private void grdDataCalendar_MouseDown(object sender, MouseEventArgs e)
        {
            Point point = new System.Drawing.Point(e.X, e.Y);

            Infragistics.Win.UIElement uiElement = ((Infragistics.Win.UltraWinGrid.UltraGridBase)sender).DisplayLayout.UIElement.ElementFromPoint(point);


            if (uiElement == null || uiElement.Parent == null)
            {
                return;
            }

            Infragistics.Win.UltraWinGrid.UltraGridRow row = (Infragistics.Win.UltraWinGrid.UltraGridRow)uiElement.GetContext(typeof(Infragistics.Win.UltraWinGrid.UltraGridRow));
            if (e.Button == MouseButtons.Right)
            {
                if (row != null)
                {
                    _RowIndexgrdDataCalendar = row.Index;
                    grdDataCalendar.Rows[row.Index].Selected = true;
                    int CalendarStatusId = int.Parse(grdDataCalendar.Selected.Rows[0].Cells["i_CalendarStatusId"].Value.ToString());
                    int LineStatusId     = int.Parse(grdDataCalendar.Selected.Rows[0].Cells["i_LineStatusId"].Value.ToString());
                    int ServiceStatusId  = int.Parse(grdDataCalendar.Selected.Rows[0].Cells["i_ServiceStatusId"].Value.ToString());
                    _PacientId = grdDataCalendar.Selected.Rows[0].Cells["v_PersonId"].Value.ToString();

                    if (CalendarStatusId == (int)Common.CalendarStatus.Agendado)
                    {
                        contextMenuStrip1.Items["mnuCancelCalendar"].Enabled   = true;
                        contextMenuStrip1.Items["mnuFinCircuito"].Enabled      = false;
                        contextMenuStrip1.Items["mnuComenzarCircuito"].Enabled = true;
                        contextMenuStrip1.Items["mnuReagendarCita"].Enabled    = true;
                    }
                    else if (CalendarStatusId == (int)Common.CalendarStatus.Atendido)
                    {
                        contextMenuStrip1.Items["mnuCancelCalendar"].Enabled   = false;
                        contextMenuStrip1.Items["mnuFinCircuito"].Enabled      = true;
                        contextMenuStrip1.Items["mnuComenzarCircuito"].Enabled = false;
                        contextMenuStrip1.Items["mnuReagendarCita"].Enabled    = false;
                    }
                    else if (CalendarStatusId == (int)Common.CalendarStatus.Cancelado)
                    {
                        contextMenuStrip1.Items["mnuCancelCalendar"].Enabled   = false;
                        contextMenuStrip1.Items["mnuFinCircuito"].Enabled      = false;
                        contextMenuStrip1.Items["mnuComenzarCircuito"].Enabled = false;
                        contextMenuStrip1.Items["mnuReagendarCita"].Enabled    = true;
                    }

                    if (LineStatusId == (int)Common.LineStatus.FueraCircuito && CalendarStatusId == (int)Common.CalendarStatus.Atendido)
                    {
                        contextMenuStrip1.Items["mnuCancelCalendar"].Enabled   = false;
                        contextMenuStrip1.Items["mnuFinCircuito"].Enabled      = false;
                        contextMenuStrip1.Items["mnuComenzarCircuito"].Enabled = false;
                        contextMenuStrip1.Items["mnuReagendarCita"].Enabled    = false;
                    }

                    OperationResult             objOperationResult   = new OperationResult();
                    ServiceBL                   objServiceBL         = new ServiceBL();
                    List <ServiceComponentList> ListServiceComponent = new List <ServiceComponentList>();
                    _strServicelId       = grdDataCalendar.Selected.Rows[0].Cells[5].Value.ToString();
                    ListServiceComponent = objServiceBL.GetServiceComponents(ref objOperationResult, _strServicelId);
                    grdDataServiceComponent.DataSource = ListServiceComponent;
                }
                else
                {
                    contextMenuStrip1.Items["mnuCancelCalendar"].Enabled   = false;
                    contextMenuStrip1.Items["mnuFinCircuito"].Enabled      = false;
                    contextMenuStrip1.Items["mnuComenzarCircuito"].Enabled = false;
                    contextMenuStrip1.Items["mnuReagendarCita"].Enabled    = false;
                }
            }

            if (e.Button == MouseButtons.Left)
            {
                if (row != null)
                {
                    OperationResult             objOperationResult   = new OperationResult();
                    ServiceBL                   objServiceBL         = new ServiceBL();
                    List <ServiceComponentList> ListServiceComponent = new List <ServiceComponentList>();
                    PacientBL                   objPacientBL         = new PacientBL();
                    personDto                   objpersonDto         = new personDto();
                    _PacientId = grdDataCalendar.Selected.Rows[0].Cells["v_PersonId"].Value.ToString();
                    //string strServicelId = grdDataCalendar.Selected.Rows[0].Cells[5].Value.ToString();
                    _strServicelId       = grdDataCalendar.Selected.Rows[0].Cells[5].Value.ToString();
                    ListServiceComponent = objServiceBL.GetServiceComponents(ref objOperationResult, _strServicelId);
                    grdDataServiceComponent.DataSource = ListServiceComponent;

                    txtTrabajador.Text = grdDataCalendar.Selected.Rows[0].Cells["v_Pacient"].Value.ToString();

                    if (grdDataCalendar.Selected.Rows[0].Cells["v_WorkingOrganizationName"].Value != null)
                    {
                        WorkingOrganization.Text = grdDataCalendar.Selected.Rows[0].Cells["v_WorkingOrganizationName"].Value.ToString();
                    }

                    txtProtocol.Text = grdDataCalendar.Selected.Rows[0].Cells["v_ProtocolName"].Value == null ? "" : grdDataCalendar.Selected.Rows[0].Cells["v_ProtocolName"].Value.ToString();
                    txtService.Text  = grdDataCalendar.Selected.Rows[0].Cells["v_ServiceName"].Value.ToString();

                    if (grdDataCalendar.Selected.Rows[0].Cells["v_ProtocolId"].Value != null)
                    {
                        if (grdDataCalendar.Selected.Rows[0].Cells["v_ProtocolId"].Value.ToString() == Constants.CONSULTAMEDICA)
                        {
                            txtTypeESO.Text = "";
                        }
                        else
                        {
                            txtTypeESO.Text = grdDataCalendar.Selected.Rows[0].Cells["v_EsoTypeName"].Value.ToString();
                        }
                    }

                    _personName = grdDataCalendar.Selected.Rows[0].Cells["v_Pacient"].Value.ToString();

                    objpersonDto = objPacientBL.GetPerson(ref objOperationResult, _PacientId);

                    Byte[] ooo = objpersonDto.b_PersonImage;

                    if (ooo == null)
                    {
                        pbImage.Image = Resources.nofoto;
                    }
                    else
                    {
                        pbImage.Image = Common.Utils.BytesArrayToImageOficce(ooo, pbImage);
                        _personImage  = ooo;
                    }

                    // Huella y Firma
                    if (objpersonDto.b_FingerPrintImage == null)
                    {
                        txtExisteHuella.Text      = "NO REGISTRADO";
                        txtExisteHuella.ForeColor = Color.Red;
                    }
                    else
                    {
                        txtExisteHuella.Text      = "REGISTRADO";
                        txtExisteHuella.ForeColor = Color.DarkBlue;
                    }

                    // Firma
                    if (objpersonDto.b_RubricImage == null)
                    {
                        txtExisteFirma.Text      = "NO REGISTRADO";
                        txtExisteFirma.ForeColor = Color.Red;
                    }
                    else
                    {
                        txtExisteFirma.Text      = "REGISTRADO";
                        txtExisteFirma.ForeColor = Color.DarkBlue;
                    }
                }
            }
        }
Пример #8
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            OperationResult objOperationResult = new OperationResult();
            string          Result             = "";

            if (uvPacient.Validate(true, false).IsValid)
            {
                if (txtName.Text.Trim() == "")
                {
                    MessageBox.Show("Por favor ingrese un nombre apropiado para Nombres.", "Error de validación", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                if (txtFirstLastName.Text.Trim() == "")
                {
                    MessageBox.Show("Por favor ingrese un nombre apropiado para Apellido Paterno.", "Error de validación", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                if (txtSecondLastName.Text.Trim() == "")
                {
                    MessageBox.Show("Por favor ingrese un nombre apropiado para Apellido Materno.", "Error de validación", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                if (txtDocNumber.Text.Trim() == "")
                {
                    MessageBox.Show("Por favor ingrese un nombre apropiado para Número Documento.", "Error de validación", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                if (txtMail.Text.Trim() != "")
                {
                    if (!Sigesoft.Common.Utils.email_bien_escrito(txtMail.Text.Trim()))
                    {
                        MessageBox.Show("Por favor ingrese un Email con formato correcto.", "Error de validación", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }
                }

                if (dtpBirthdate.Checked == false)
                {
                    MessageBox.Show("Por favor ingrese una fecha de nacimiento.", "Error de validación", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
                int caracteres = txtDocNumber.TextLength;
                if (int.Parse(ddlDocTypeId.SelectedValue.ToString()) == (int)Common.Document.DNI)
                {
                    if (caracteres != 8)
                    {
                        MessageBox.Show("La cantida de caracteres de Número Documento es invalido.", "Error de validación", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                }
                else if (int.Parse(ddlDocTypeId.SelectedValue.ToString()) == (int)Common.Document.PASAPORTE)
                {
                    if (caracteres != 9)
                    {
                        MessageBox.Show("La cantida de caracteres de Número Documento es invalido.", "Error de validación", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                }
                else if (int.Parse(ddlDocTypeId.SelectedValue.ToString()) == (int)Common.Document.LICENCIACONDUCIR)
                {
                    if (caracteres != 9)
                    {
                        MessageBox.Show("La cantida de caracteres de Número Documento es invalido.", "Error de validación", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                }
                else if (int.Parse(ddlDocTypeId.SelectedValue.ToString()) == (int)Common.Document.CARNETEXTRANJ)
                {
                    if (caracteres < 9)
                    {
                        MessageBox.Show("La cantida de caracteres de Número Documento es invalido.", "Error de validación", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                }
                if (Mode == "New")
                {
                    // Populate the entity
                    objpersonDto                     = new personDto();
                    objpersonDto.v_FirstName         = txtName.Text.Trim();
                    objpersonDto.v_FirstLastName     = txtFirstLastName.Text.Trim();
                    objpersonDto.v_SecondLastName    = txtSecondLastName.Text.Trim();
                    objpersonDto.i_DocTypeId         = Convert.ToInt32(ddlDocTypeId.SelectedValue);
                    objpersonDto.i_SexTypeId         = Convert.ToInt32(ddlSexTypeId.SelectedValue);
                    objpersonDto.i_MaritalStatusId   = Convert.ToInt32(ddlMaritalStatusId.SelectedValue);
                    objpersonDto.i_LevelOfId         = Convert.ToInt32(ddlLevelOfId.SelectedValue);
                    objpersonDto.v_DocNumber         = txtDocNumber.Text.Trim();
                    objpersonDto.d_Birthdate         = dtpBirthdate.Value;
                    objpersonDto.v_BirthPlace        = txtBirthPlace.Text.Trim();
                    objpersonDto.v_TelephoneNumber   = txtTelephoneNumber.Text.Trim();
                    objpersonDto.v_AdressLocation    = txtAdressLocation.Text.Trim();
                    objpersonDto.v_Mail              = txtMail.Text.Trim();
                    objpersonDto.v_CurrentOccupation = txtCurrentOccupation.Text.Trim();

                    objpersonDto.b_FingerPrintTemplate = FingerPrintTemplate;
                    objpersonDto.b_FingerPrintImage    = FingerPrintImage;
                    objpersonDto.b_RubricImage         = RubricImage;
                    objpersonDto.t_RubricImageText     = RubricImageText;

                    objpersonDto.i_Relationship     = Convert.ToInt32(ddlRelationshipId.SelectedValue);
                    objpersonDto.i_AltitudeWorkId   = Convert.ToInt32(ddlAltitudeWorkId.SelectedValue);
                    objpersonDto.i_PlaceWorkId      = Convert.ToInt32(ddlPlaceWorkId.SelectedValue);
                    objpersonDto.v_ExploitedMineral = txtExploitedMineral.Text;

                    if (pbPersonImage.Image != null)
                    {
                        MemoryStream ms = new MemoryStream();
                        Bitmap       bm = new Bitmap(pbPersonImage.Image);
                        bm.Save(ms, ImageFormat.Bmp);

                        objpersonDto.b_PersonImage = Common.Utils.ResizeUploadedImage(ms);
                        pbPersonImage.Image.Dispose();
                    }
                    else
                    {
                        objpersonDto.b_PersonImage = null;
                    }

                    // Save the data
                    Result = _objPacientBL.AddPacient(ref objOperationResult, objpersonDto, Globals.ClientSession.GetAsList());
                }
                else if (Mode == "Edit")
                {
                    // Populate the entity
                    objpersonDto = new personDto();

                    objpersonDto                       = _objPacientBL.GetPerson(ref objOperationResult, PacientId);
                    objpersonDto.v_PersonId            = PacientId;
                    objpersonDto.v_FirstName           = txtName.Text.Trim();
                    objpersonDto.v_FirstLastName       = txtFirstLastName.Text.Trim();
                    objpersonDto.v_SecondLastName      = txtSecondLastName.Text.Trim();
                    objpersonDto.i_DocTypeId           = Convert.ToInt32(ddlDocTypeId.SelectedValue);
                    objpersonDto.i_SexTypeId           = Convert.ToInt32(ddlSexTypeId.SelectedValue);
                    objpersonDto.i_MaritalStatusId     = Convert.ToInt32(ddlMaritalStatusId.SelectedValue);
                    objpersonDto.i_LevelOfId           = Convert.ToInt32(ddlLevelOfId.SelectedValue);
                    objpersonDto.v_DocNumber           = txtDocNumber.Text.Trim();
                    objpersonDto.d_Birthdate           = dtpBirthdate.Value;
                    objpersonDto.v_BirthPlace          = txtBirthPlace.Text.Trim();
                    objpersonDto.v_TelephoneNumber     = txtTelephoneNumber.Text.Trim();
                    objpersonDto.v_AdressLocation      = txtAdressLocation.Text.Trim();
                    objpersonDto.v_Mail                = txtMail.Text.Trim();
                    objpersonDto.v_CurrentOccupation   = txtCurrentOccupation.Text.Trim();
                    objpersonDto.b_FingerPrintTemplate = FingerPrintTemplate;
                    objpersonDto.b_FingerPrintImage    = FingerPrintImage;
                    objpersonDto.b_RubricImage         = RubricImage;
                    objpersonDto.t_RubricImageText     = RubricImageText;

                    objpersonDto.i_Relationship     = Convert.ToInt32(ddlRelationshipId.SelectedValue);
                    objpersonDto.i_AltitudeWorkId   = Convert.ToInt32(ddlAltitudeWorkId.SelectedValue);
                    objpersonDto.i_PlaceWorkId      = Convert.ToInt32(ddlPlaceWorkId.SelectedValue);
                    objpersonDto.v_ExploitedMineral = txtExploitedMineral.Text;

                    if (pbPersonImage.Image != null)
                    {
                        MemoryStream ms = new MemoryStream();
                        Bitmap       bm = new Bitmap(pbPersonImage.Image);
                        bm.Save(ms, ImageFormat.Bmp);
                        objpersonDto.b_PersonImage = Common.Utils.ResizeUploadedImage(ms);
                        pbPersonImage.Image.Dispose();
                    }
                    else
                    {
                        objpersonDto.b_PersonImage = null;
                    }

                    // Save the data
                    Result = _objPacientBL.UpdatePacient(ref objOperationResult, objpersonDto, Globals.ClientSession.GetAsList(), NumberDocument, txtDocNumber.Text);
                }
                //// Analizar el resultado de la operación
                if (objOperationResult.Success == 1)  // Operación sin error
                {
                    this.DialogResult = System.Windows.Forms.DialogResult.OK;
                    this.Close();
                }
                else  // Operación con error
                {
                    if (Result == "-1")
                    {
                        MessageBox.Show("El Número de documento ya existe.", "! ERROR !", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    else
                    {
                        MessageBox.Show(Constants.GenericErrorMessage, "! ERROR !", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        // Se queda en el formulario.
                    }
                }
            }
            else
            {
                MessageBox.Show("Por favor corrija la información ingresada. Vea los indicadores de error.", "Error de validación", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Пример #9
0
        private void LoadDataExternalUser()
        {
            // Setear lenght dimamicos de numero de documento
            SetLenght(ddlDocType.SelectedValue.ToString());

            OperationResult objCommonOperationResultedit = new OperationResult();

            objPerson = _objPacientBL.GetPerson(ref objCommonOperationResultedit, _personId);

            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;
            ddlDocType.SelectedValue = objPerson.i_DocTypeId.ToString();
            txtDocNumber.Text        = objPerson.v_DocNumber;
            txtMail.Text             = objPerson.v_Mail;


            for (int i = 0; i < chkEmpresas.Items.Count - 1; i++)
            {
                chkEmpresas.SetItemChecked(i, false);
            }

            // Informacion del usuario
            OperationResult objOperationResult = new OperationResult();

            _objSystemUserTemp = _objSecurityBL.GetSystemUser(ref objOperationResult, _systemUserId.Value);

            //cboEmpresa.SelectedItem = item;// _objSystemUserTemp.v_SystemUserByOrganizationId == null ? "-1" : _objSystemUserTemp.v_SystemUserByOrganizationId;
            if (!string.IsNullOrEmpty(_objSystemUserTemp.v_SystemUserByOrganizationId))
            {
                var organizationIds = _objSystemUserTemp.v_SystemUserByOrganizationId.Split(',').ToList();

                foreach (var item in organizationIds)
                {
                    for (int i = 0; i < chkEmpresas.Items.Count; i++)
                    {
                        KeyValueDTO obj = (KeyValueDTO)chkEmpresas.Items[i];

                        if (obj.Id.Trim() == item.Trim())
                        {
                            chkEmpresas.SetItemChecked(i, true);
                            break;
                        }
                    }
                }
            }



            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();
        }
Пример #10
0
        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;


                ddlDocType.SelectedValue = personDTO.i_DocTypeId.ToString();
                ddlSexType.SelectedValue = personDTO.i_SexTypeId.ToString();
                txtTelephoneNumber.Text  = personDTO.v_TelephoneNumber;

                txtMail.Text = personDTO.v_Mail;

                // 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;


                //Obtener la empresa por medio del systemuserId
                var EmpresaId_ProtocoloId = _protocolBL.ObtenerEmpresaPorSystemUserId(systemUserId);
                //ddlEmpresaCliente.SelectedValue = EmpresaId_ProtocoloId.EmpresaId;

                var ListaEmpresas = oOrganizationBL.GetEmpresasPorUsuarioExterno(objSystemUser.i_SystemUserId);
                Session["ListaEmpresas"] = ListaEmpresas;
                grdData.DataSource       = ListaEmpresas;
                grdData.DataBind();

                //Obtener Los permisos por el ProtocolId
                var Permisos = _protocolBL.ObtenerPermisosPorProtocoloId(EmpresaId_ProtocoloId.ProtocoloId, systemUserId);
                foreach (var item in Permisos)
                {
                    if (item.i_ApplicationHierarchyId == 1084)
                    {
                        chkAdminServicios.Checked = true;
                    }
                    if (item.i_ApplicationHierarchyId == 2000)
                    {
                        chkAgenda.Checked = true;
                    }
                    if (item.i_ApplicationHierarchyId == 3000)
                    {
                        chkEstadistica.Checked = true;
                    }
                    else if (item.i_ApplicationHierarchyId == 1087)
                    {
                        chkCertificado.Checked = true;
                    }
                    if (item.i_ApplicationHierarchyId == 165)
                    {
                        chkExamenes.Checked = true;
                    }
                    else if (item.i_ApplicationHierarchyId == 1086)
                    {
                        chkFichaOcupacional.Checked = true;
                    }
                    else if (item.i_ApplicationHierarchyId == 1085)
                    {
                        chkSegTrabajador.Checked = true;
                    }
                }
            }
        }
Пример #11
0
        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();
            }
        }
Пример #12
0
        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();
            }
        }