public List <TurnoBE> ListarTurno() { lTurno = new List <TurnoBE>(); querySQL = "SELECT FORMAT(CONVERT(smalldatetime, DHORAINICIO),'HH:mm') , FORMAT(CONVERT(smalldatetime, DHORAFIN),'HH:mm'), CDIAINCIO, CDIAFIN, CDESCRIPCION FROM GRH_TURNO"; SqlCommand cmd = new SqlCommand(querySQL, cn.getConecction()); try { cmd.Connection.Open(); SqlDataReader rd = cmd.ExecuteReader(); while (rd.Read()) { oTurno = new TurnoBE(0, rd.GetString(0), rd.GetString(1), rd.GetString(2), rd.GetString(3), rd.GetString(4), 0); lTurno.Add(oTurno); } rd.Close(); } catch (Exception) { lTurno = null; } finally { cmd.Connection.Close(); querySQL = String.Empty; } return(lTurno); }
public TurnoBE ObtenerTurnoByOid(int oid) { TurnoBE oBE = new TurnoBE(); DataTable dt = new DataTable(); TurnoDAO oTurnoDAO = new TurnoDAO(); dt = oTurnoDAO.obtenerTurnoByOid(oid); foreach (DataRow dr in dt.Rows) { oBE.oid_turn = Int32.Parse(dr["oid_turn"].ToString()); oBE.proy_oid_proy = Int32.Parse(dr["proy_oid_proy"].ToString()); oBE.clie_oid_clie = Int32.Parse(dr["clie_oid_clie"].ToString()); oBE.come_oid_come = Int32.Parse(dr["come_oid_come"].ToString()); oBE.tise_cod_tipo_serv = dr["tise_cod_tipo_serv"].ToString(); oBE.lect_oid_lect = Int32.Parse(dr["lect_oid_lect"].ToString()); oBE.val_fech = dr["val_fech"].ToString(); oBE.ind_cier = Int32.Parse(dr["ind_cier"].ToString()); oBE.ind_elim = Int32.Parse(dr["ind_elim"].ToString()); } return(oBE); }
public int ValidarTurno(TurnoBE oTurnoBE) { TurnoDAO oTurnoDAO = new TurnoDAO(); int result; result = oTurnoDAO.ValidarTurno(oTurnoBE); return(result); }
private void btnGrabar_Click(object sender, EventArgs e) { TurnoBE oBE = new TurnoBE(); TurnoBR oBR = new TurnoBR(); oBE.proy_oid_proy = Global.oid_proy; DataRowView rvCome = cboComedor.SelectedItem as DataRowView; oBE.come_oid_come = Int32.Parse(rvCome["Codigo"].ToString()); DataRowView rvTipoServ = cboTipoServicio.SelectedItem as DataRowView; oBE.tise_cod_tipo_serv = rvTipoServ["Codigo"].ToString(); DataRowView rvLect = cboLectora.SelectedItem as DataRowView; oBE.lect_oid_lect = Int32.Parse(rvLect["Codigo"].ToString()); oBE.val_fech = dtpFecha.Value.Date.ToString("dd/MM/yyyy"); int ind_vali; ind_vali = oBR.ValidarTurno(oBE); if (ind_vali == 0) { if (mod == "C") { oBR.Insertar(oBE); } else { oBE.oid_turn = Int32.Parse(txtOid.Text); //oBR.Actualizar(oBE); } oFrm.CargarDGV(); this.Close(); } else { MessageBox.Show("El Turno ya ha sido creado", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } }
public void Insertar(TurnoBE oTurnoBE) { dbConnectionMySql oDB = new dbConnectionMySql(); MySqlParameter[] sqlParameters = new MySqlParameter[8]; sqlParameters[0] = new MySqlParameter("?p_proy_oid_proy", oTurnoBE.proy_oid_proy); sqlParameters[1] = new MySqlParameter("?p_come_oid_come", oTurnoBE.come_oid_come); sqlParameters[2] = new MySqlParameter("?p_tise_cod_tipo_serv", oTurnoBE.tise_cod_tipo_serv); sqlParameters[3] = new MySqlParameter("?p_lect_oid_lect", oTurnoBE.lect_oid_lect); sqlParameters[4] = new MySqlParameter("?p_val_fech", oTurnoBE.val_fech); sqlParameters[5] = new MySqlParameter("?p_val_cant", oTurnoBE.val_cant); sqlParameters[6] = new MySqlParameter("?p_ind_cier", oTurnoBE.ind_cier); sqlParameters[7] = new MySqlParameter("?p_ind_elim", oTurnoBE.ind_elim); oDB.EjecutarDML_SP("sp_Turno_Ins", sqlParameters); }
public int ValidarTurno(TurnoBE oTurnoBE) { dbConnectionMySql oDB = new dbConnectionMySql(); MySqlParameter[] sqlParameters = new MySqlParameter[6]; sqlParameters[0] = new MySqlParameter("?p_proy_oid_proy", oTurnoBE.proy_oid_proy); sqlParameters[1] = new MySqlParameter("?p_come_oid_come", oTurnoBE.come_oid_come); sqlParameters[2] = new MySqlParameter("?p_tise_cod_tipo_serv", oTurnoBE.tise_cod_tipo_serv); sqlParameters[3] = new MySqlParameter("?p_lect_oid_lect", oTurnoBE.lect_oid_lect); sqlParameters[4] = new MySqlParameter("?p_val_fech", oTurnoBE.val_fech); sqlParameters[5] = new MySqlParameter("?p_val_resu", MySqlDbType.Int32, 11, ParameterDirection.Output, true, 0, 0, null, DataRowVersion.Current, null); int result; result = oDB.Output_Int_SP("sp_Turno_Validar_Ins", sqlParameters); return(result); }
private void btnGrabar_Click(object sender, EventArgs e) { TurnoBE oBE = new TurnoBE(); TurnoBR oBR = new TurnoBR(); //oBE.val_fech = txtDescripcion.Text; //MessageBox.Show(dtpFecha.Value.Date.ToString("dd/MM/yyyy")); oBE.val_fech = dtpFecha.Value.Date.ToString("dd/MM/yyyy"); oBR.Insertar(oBE); oFrm.CargarDGV(); this.Close(); }
public void Insertar(TurnoBE oTurnoBE) { TurnoDAO oTurnoDAO = new TurnoDAO(); oTurnoDAO.Insertar(oTurnoBE); }
public bool Alta(TurnoBE value) { return(this._dal.Alta(value)); }