Esempio n. 1
0
        private void grdDataHabitaciones_AfterSelectChange(object sender, Infragistics.Win.UltraWinGrid.AfterSelectChangeEventArgs e)
        {
            if (grdDataHabitaciones.Selected.Rows.Count == 0)
            {
                return;
            }
            OperationResult     objOperationResult = new OperationResult();
            SystemParameterList habHospit          = new SystemParameterList();

            if (_mode == "NewASEGU")
            {
                #region Conexion SAM
                ConexionSigesoft conectasam = new ConexionSigesoft();
                conectasam.opensigesoft();
                #endregion
                var           cadena1 = "select r_HospitalBedPrice from protocol where v_ProtocolId ='" + _v_ProtocoloId + "'";
                SqlCommand    comando = new SqlCommand(cadena1, connection: conectasam.conectarsigesoft);
                SqlDataReader lector  = comando.ExecuteReader();
                string        hab     = "0.00";
                while (lector.Read())
                {
                    hab = lector.GetValue(0).ToString();
                }
                lector.Close();
                txtPrecio.Text    = double.Parse(hab).ToString("N2");
                txtPrecio.Enabled = false;
            }
            else
            {
                int HabitacionId = int.Parse(grdDataHabitaciones.Selected.Rows[0].Cells["i_HabitacionId"].Value.ToString());
                habHospit = _hospitalizacionBL.GetHabitaciónH(ref objOperationResult, HabitacionId);

                txtPrecio.Text = double.Parse(habHospit.v_Value2).ToString("N2");
            }
        }
Esempio n. 2
0
        private void cboHabitación_SelectedIndexChanged(object sender, EventArgs e)
        {
            OperationResult     objOperationResult = new OperationResult();
            SystemParameterList habHospit          = new SystemParameterList();

            if (cboHabitación.SelectedValue == null)
            {
                return;
            }
            if (cboHabitación.SelectedValue.ToString() == "-1")
            {
                txtPrecio.Text = ".";
                return;
            }
            if (_mode == "NewASEGU")
            {
                #region Conexion SAM
                ConexionSigesoft conectasam = new ConexionSigesoft();
                conectasam.opensigesoft();
                #endregion
                var           cadena1 = "select r_HospitalBedPrice from protocol where v_ProtocolId ='" + _v_ProtocoloId + "'";
                SqlCommand    comando = new SqlCommand(cadena1, connection: conectasam.conectarsigesoft);
                SqlDataReader lector  = comando.ExecuteReader();
                string        hab     = "";
                while (lector.Read())
                {
                    hab = lector.GetValue(0).ToString();
                }
                lector.Close();
                txtPrecio.Text    = hab;
                txtPrecio.Enabled = false;
            }
            else
            {
                habHospit = _hospitalizacionBL.GetHabitaciónH(ref objOperationResult, int.Parse(cboHabitación.SelectedValue.ToString()));

                txtPrecio.Text = habHospit.v_Value2;
            }
        }