protected void btnRegistro_Click(object sender, EventArgs e) { OT ot = new OT(); Bu_OrdenTrabajo bu = new Bu_OrdenTrabajo(); if (ddlCliente.SelectedValue == "0") { Response.Write("<script language=javascript>alert('DEBES SELECCIONAR UNA EMPRESA');</script>"); } else { ot.fecha_inicio = Convert.ToDateTime(txtFechaTrabajo.Text.Trim()); } //else if (txtRequerimiento.t) //{ // //u.usuario_rut = v.Aux; // //u.usuario_dv = v.dv; // //u.usuario_us = txtUs.Text.Trim(); // //u.usuario_pw = txtPw.Text.Trim(); // //u.usuario_nombre = txtNombre.Text.Trim(); // //u.usuario_paterno = txtPaterno.Text.Trim(); // //u.usuario_materno = txtMaterno.Text.Trim(); // //u.usuario_nacimiento = Convert.ToDateTime(txtNacimiento.Text.Trim()); // //u.id_user = 16712750; // //u.tipo_usuario_id = Convert.ToInt32(ddlTipoUsuario.SelectedValue); // //bu.IngresaUsuario(u); //} //else //{ // Response.Write("<script language=javascript>alert('RUT INVALIDO VERIFIQUE');</script>"); //} }
protected void btnRegistro_Click(object sender, EventArgs e) { OT ot = new OT(); Bu_OrdenTrabajo bu = new Bu_OrdenTrabajo(); if (ddlEmpresa.SelectedValue == "0") { Response.Write("<script language=javascript>alert('DEBES SELECCIONAR UNA EMPRESA');</script>"); } else { try { ot.fecha_trabajo = Convert.ToDateTime(txtFechaTrabajo.Text.Trim()); ot.hora_inicio = txtHoraInicio.Text; ot.hora_fin = txtHoraTermino.Text; ot.cantidad_hora = Convert.ToInt32(txtHH.Text.Trim()); ot.requerimiento = txtRequerimiento.Value.Trim().ToUpper(); ot.solucion = txtSolucion.Value.Trim().ToUpper(); ot.contacto_empresa_id = Convert.ToInt32(ddlContacto.SelectedValue); ot.id_user = 16712750; bu.RegistrarOT(ot); recarga(); } catch (Exception) { Response.Write("<script language=javascript>alert('ERROR : " + e.ToString() + "');</script>"); } } }
private void CargaBox(DropDownList control, int flag, int ddlFlag) { Bu_OrdenTrabajo box = new Bu_OrdenTrabajo(); DataSet ds = box.CargaCombos(flag, ddlFlag); control.DataSource = ds; control.DataTextField = "Nombre"; control.DataValueField = "Codigo"; control.DataBind(); }