private void fillForm() { int Id = 0; int.TryParse(hfId.Value, out Id); try { Transporte_tipoMng oTTMng = new Transporte_tipoMng(); Transporte_tipo oTT = new Transporte_tipo(); oTT.Id = Id; oTTMng.O_Transporte_tipo = oTT; oTTMng.selById(); txt_nombre.Text = oTT.Nombre; txt_peso_maximo.Text = oTT.Peso_maximo.ToString(); chkPlaca.Checked = oTT.Requiere_placa; chkCaja.Checked = oTT.Requiere_caja; chkCaja1.Checked = oTT.Requiere_caja1; chkCaja2.Checked = oTT.Requiere_caja2; } catch { throw; } }
private void fillNOAsociados(int IdTransporte) { try { Transporte_tipo oTT = new Transporte_tipo(); oTT.Id = IdTransporte; Transporte_tipoMng oTTMng = new Transporte_tipoMng(); oTTMng.O_Transporte_tipo = oTT; oTTMng.getByIdTransporte(); Transporte_tipoMng oTTMngAll = new Transporte_tipoMng(); oTTMngAll.fillLst(); List <Transporte_tipo> lstTTNSel = new List <Transporte_tipo>(); foreach (Transporte_tipo itemTT in oTTMngAll.Lst) { if (!oTTMng.Lst.Exists(p => p.Id == itemTT.Id)) { lstTTNSel.Add(itemTT); } } lstNoAsociados.Items.Clear(); lstNoAsociados.DataSource = lstTTNSel; lstNoAsociados.DataValueField = "id"; lstNoAsociados.DataTextField = "nombre"; lstNoAsociados.DataBind(); } catch { throw; } }
private void validarPlacas(int IdTransporteTipo) { if (IdTransporteTipo > 0) { Transporte_tipoMng oMng = new Transporte_tipoMng(); Transporte_tipo o = new Transporte_tipo(); o.Id = IdTransporteTipo; oMng.O_Transporte_tipo = o; oMng.selById(); txt_placa.Text = string.Empty; txt_placa.ReadOnly = (!o.Requiere_placa); txt_caja_1.Text = string.Empty; txt_caja_1.ReadOnly = (!o.Requiere_caja1); txt_caja_2.Text = string.Empty; txt_caja_2.ReadOnly = (!o.Requiere_caja2); if (txt_placa.ReadOnly) { txt_placa.Text = "N.A."; } if (txt_caja_1.ReadOnly) { txt_caja_1.Text = "N.A."; } if (txt_caja_2.ReadOnly) { txt_caja_2.Text = "N.A."; } } }
public static Tarima_almacen_remision tarimaRemisionGetAllInfoById(int id_remision) { Tarima_almacen_remision o = new Tarima_almacen_remision(); try { Tarima_almacen_remisionMng oMng = new Tarima_almacen_remisionMng(); o.Id = id_remision; oMng.O_Tarima_almacen_remision = o; oMng.selById(); Tarima_almacen_remision_detailMng oTARDetMng = new Tarima_almacen_remision_detailMng(); Tarima_almacen_remision_detail oTARDet = new Tarima_almacen_remision_detail() { Id_tarima_almacen_remision = id_remision }; oTARDetMng.O_Tarima_almacen_remision_detail = oTARDet; oTARDetMng.fillLstByIdRemision(); o.PLstTARDet = oTARDetMng.Lst; Tarima_almacen_traficoMng oTATMng = new Tarima_almacen_traficoMng(); Tarima_almacen_trafico oTAT = new Tarima_almacen_trafico() { Id = o.Id_tarima_almacen_trafico }; oTATMng.O_Tarima_almacen_trafico = oTAT; oTATMng.selById(); TransporteMng oTMng = new TransporteMng(); Transporte oT = new Transporte(); oT.Id = Convert.ToInt32(oTAT.Id_transporte); oTMng.O_Transporte = oT; oTMng.selById(); oTAT.PTransporte = oT; Transporte_tipoMng oTTMng = new Transporte_tipoMng(); Transporte_tipo oTT = new Transporte_tipo(); oTT.Id = oTAT.Id_transporte_tipo; oTTMng.O_Transporte_tipo = oTT; oTTMng.selById(); oTAT.PTransporteTipo = oTT; o.PTarAlmTrafico = oTAT; UsuarioMng oUMng = new UsuarioMng(); Usuario oU = new Usuario() { Id = o.Id_usuario_elaboro }; oUMng.O_Usuario = oU; oUMng.selById(); o.PUsuario = oU; } catch { throw; } return(o); }
private void istTransporte_tipo(Transporte_tipo oTT) { try { Transporte_tipoMng oTTMng = new Transporte_tipoMng(); oTTMng.O_Transporte_tipo = oTT; oTTMng.add(); } catch { throw; } }
private void validarTipoTransporte(int IdTransporteTipo) { try { if (IdTransporteTipo > 0) { Transporte_tipoMng oMng = new Transporte_tipoMng(); Transporte_tipo o = new Transporte_tipo(); o.Id = IdTransporteTipo; oMng.O_Transporte_tipo = o; oMng.selById(); //rv_total_carga_max.MinimumValue = "0"; //rv_total_carga_max.MaximumValue = o.Peso_maximo.ToString(); //rv_total_carga_max.ErrorMessage = "El peso excede los " + o.Peso_maximo.ToString() + " Kg, para el tipo de transrpote selecccionado"; txt_placa.Text = string.Empty; txt_placa.ReadOnly = (!o.Requiere_placa); txt_caja.Text = string.Empty; txt_caja.ReadOnly = (!o.Requiere_caja); txt_caja_1.Text = string.Empty; txt_caja_1.ReadOnly = (!o.Requiere_caja1); txt_caja_2.Text = string.Empty; txt_caja_2.ReadOnly = (!o.Requiere_caja2); if (txt_placa.ReadOnly) { txt_placa.Text = "N.A."; } if (txt_caja.ReadOnly) { txt_caja.Text = "N.A."; } if (txt_caja_1.ReadOnly) { txt_caja_1.Text = "N.A."; } if (txt_caja_2.ReadOnly) { txt_caja_2.Text = "N.A."; } } } catch { throw; } }
private void validarTipo(int IdTransporteTipo) { try { //if (IdTransporteTipo > 0 && string.Compare(hf_click_save.Value, "1") != 0) if (IdTransporteTipo > 0) { Transporte_tipo o = CatalogCtrl.Transporte_tipo_getyById(IdTransporteTipo); //rv_total_carga_max.MinimumValue = "0"; //rv_total_carga_max.MaximumValue = o.Peso_maximo.ToString(); //rv_total_carga_max.ErrorMessage = "El peso excede los " + o.Peso_maximo.ToString() + " Kg, para el tipo de transrpote selecccionado"; txt_placa.Text = string.Empty; txt_placa.ReadOnly = (!o.Requiere_placa); txt_caja.Text = string.Empty; txt_caja.ReadOnly = (!o.Requiere_caja); txt_caja_1.Text = string.Empty; txt_caja_1.ReadOnly = (!o.Requiere_caja1); txt_caja_2.Text = string.Empty; txt_caja_2.ReadOnly = (!o.Requiere_caja2); if (txt_placa.ReadOnly) { txt_placa.Text = "N.A."; } if (txt_caja.ReadOnly) { txt_caja.Text = "N.A."; } if (txt_caja_1.ReadOnly) { txt_caja_1.Text = "N.A."; } if (txt_caja_2.ReadOnly) { txt_caja_2.Text = "N.A."; } hf_cond_trans.Value = Newtonsoft.Json.JsonConvert.SerializeObject(TransporteCtrl.TransCondByTransporteTipo(IdTransporteTipo, false, true)); } } catch { throw; } }
protected void lnk_change_status_click(object sender, CommandEventArgs args) { try { int Id = 0; int.TryParse(args.CommandName, out Id); bool status = false; bool.TryParse(args.CommandArgument.ToString(), out status); Transporte_tipo oTT = new Transporte_tipo(); oTT.Id = Id; //Valida que no existe en la tabla Transporte_tipo_transporte Transporte_tipo_transporte oTTT = new Transporte_tipo_transporte(); oTTT.Id_transporte_tipo = oTT.Id; Transporte_tipo_transporteMng oTTTMng = new Transporte_tipo_transporteMng(); oTTTMng.O_Transporte_tipo_transporte = oTTT; oTTTMng.selByIdTransporteTipo(); if (oTTT.Id > 0) { throw new Exception("Es necesario eliminar este tipo de trasnporte en la relacion de Transportes-Tipos"); } Transporte_tipoMng oTTMng = new Transporte_tipoMng(); oTTMng.O_Transporte_tipo = oTT; if (status) { oTTMng.dlt(); } else { oTTMng.reactive(); } oTTMng = new Transporte_tipoMng(); oTTMng.fillAllLst(); fillCatalog(oTTMng.Lst); } catch (Exception e) { ((MstCasc)this.Master).setError = e.Message; } }
private void fillAsociados(int IdTransporte) { try { Transporte_tipo oTT = new Transporte_tipo(); oTT.Id = IdTransporte; Transporte_tipoMng oTTMng = new Transporte_tipoMng(); oTTMng.O_Transporte_tipo = oTT; oTTMng.getByIdTransporte(); lstAsociados.Items.Clear(); lstAsociados.DataSource = oTTMng.Lst; lstAsociados.DataValueField = "id"; lstAsociados.DataTextField = "nombre"; lstAsociados.DataBind(); } catch { throw; } }
private Transporte_tipo getFormValues() { Transporte_tipo oTT = new Transporte_tipo(); int entero = 0; int.TryParse(hfId.Value, out entero); oTT.Id = entero; entero = 0; oTT.Nombre = txt_nombre.Text.Trim(); int.TryParse(txt_peso_maximo.Text, out entero); oTT.Peso_maximo = entero; entero = 0; oTT.Requiere_placa = chkPlaca.Checked; oTT.Requiere_caja = chkCaja.Checked; oTT.Requiere_caja1 = chkCaja1.Checked; oTT.Requiere_caja2 = chkCaja2.Checked; return(oTT); }
public static void fillTipoTransporte(DropDownList ddlTipo_Transporte, DropDownList ddlTransporte) { try { Transporte_tipoMng oMng = new Transporte_tipoMng(); Transporte_tipo o = new Transporte_tipo(); ddlTipo_Transporte.Items.Clear(); if (ddlTransporte.Items.Count > 0) { o.Id = Convert.ToInt32(ddlTransporte.SelectedValue); oMng.O_Transporte_tipo = o; oMng.getByIdTransporte(); ddlTipo_Transporte.Items.Clear(); ddlTipo_Transporte.DataSource = oMng.Lst; ddlTipo_Transporte.DataTextField = "nombre"; ddlTipo_Transporte.DataValueField = "id"; ddlTipo_Transporte.DataBind(); } } catch { throw; } }
private string transporte_tipo(HttpContext context) { option = context.Request["opt"].ToString(); Transporte_tipo o = new Transporte_tipo(); switch (option) { case "sltById": if (context.Request["key"] != null) { int.TryParse(context.Request["key"], out id); } o.Id = id; CatalogoCtrl.catalogSelById(o); response = JsonConvert.SerializeObject(o); break; case "add": jsonData = new StreamReader(context.Request.InputStream).ReadToEnd(); o = JsonConvert.DeserializeObject <Transporte_tipo>(jsonData); o.Id = CatalogoCtrl.catalogAdd(o); response = JsonConvert.SerializeObject(o); break; case "udt": jsonData = new StreamReader(context.Request.InputStream).ReadToEnd(); o = JsonConvert.DeserializeObject <Transporte_tipo>(jsonData); CatalogoCtrl.catalogUdt(o); response = JsonConvert.SerializeObject(o); break; case "lst": response = JsonConvert.SerializeObject(CatalogoCtrl.catalogGetLst(o).Cast <Transporte_tipo>().ToList()); break; case "lstAll": response = JsonConvert.SerializeObject(CatalogoCtrl.catalogGetAllLst(o).Cast <Transporte_tipo>().ToList()); break; case "enb": if (context.Request["key"] != null) { int.TryParse(context.Request["key"], out id); } o.Id = id; CatalogoCtrl.catalogEnabled(o); o.IsActive = true; response = JsonConvert.SerializeObject(o); break; case "dsb": if (context.Request["key"] != null) { int.TryParse(context.Request["key"], out id); } o.Id = id; CatalogoCtrl.catalogDisabled(o); o.IsActive = false; response = JsonConvert.SerializeObject(o); break; default: break; } return(response); }
private Salida getSalidaFormValues() { Salida oS = new Salida(); int numero; double doble; //Usuario oS.PUsuario = ((MstCasc)this.Master).getUsrLoged(); //Bodega int.TryParse(ddlBodega.SelectedValue, out numero); oS.Id_bodega = numero; numero = 0; //Fecha oS.Fecha = DateTime.Today; //Hora oS.Hora_salida = txt_hora_salida.Text; //Cortina int.TryParse(ddlCortina.SelectedValue, out numero); oS.Id_cortina = numero; numero = 0; //Cliente int.TryParse(ddlCliente.SelectedValue, out numero); oS.Id_cliente = numero; numero = 0; //Referencia if (rfvReferencia.Enabled) { oS.Referencia = txt_referencia.Text; } else { oS.Referencia = string.Empty; } //Destino oS.Destino = txt_destino.Text; //Mercancia oS.Mercancia = txt_mercancia.Text; //Linea de Transporte int.TryParse(ddlTransporte.SelectedValue, out numero); oS.Id_transporte = numero; numero = 0; //Tipo de transporte int.TryParse(ddlTipo_Transporte.SelectedValue, out numero); oS.Id_transporte_tipo = numero; numero = 0; //Placa oS.Placa = txt_placa.Text; //Caja oS.Caja = txt_caja.Text; //Caja1 oS.Caja1 = txt_caja_1.Text; //Caja2 oS.Caja2 = txt_caja_2.Text; //Sello oS.Sello = txt_sello.Text; //Talon oS.Talon = txt_talon.Text; //Custodia int.TryParse(ddlCustodia.SelectedValue, out numero); oS.Id_custodia = numero; numero = 0; //Operador de la custodia oS.Operador = txt_operador.Text; //Numero de pallet int.TryParse(txt_no_pallet.Text, out numero); oS.No_pallet = numero; numero = 0; //Numero de bulto int.TryParse(txt_no_bulto.Text, out numero); oS.No_bulto = numero; numero = 0; //Numero de pieza int.TryParse(txt_no_pieza.Text, out numero); oS.No_pieza = numero; numero = 0; //Peso unitario double.TryParse(txt_peso_unitario.Text, out doble); oS.Peso_unitario = doble; doble = 0; //Total de carga double.TryParse(txt_total_carga.Text, out doble); oS.Total_carga = doble; doble = 0; //Es consolidada oS.EsCompartida = Convert.ToBoolean(hfConsolidada.Value); //Es parcial oS.Es_unica = true; if (!chk_tipo_salida.Checked) { Salida_parcial oSP = new Salida_parcial(); oSP.Referencia = oS.Referencia; oSP.Es_ultima = chk_ultima.Checked; oSP.Id_usuario = oS.PUsuario.Id; oS.PSalPar = oSP; oS.Es_unica = false; } //Hora carga oS.Hora_carga = txt_hora_carga.Text; //Observaciones oS.Observaciones = txt_observaciones.Text; //Documentos asociados a la salida oS.PLstSalDoc = VSLstSD; //Se obtiene la descripcion de los tipos de documento DocumentoMng oDocMng = new DocumentoMng(); foreach (Salida_documento itemSD in oS.PLstSalDoc) { Documento oDoc = new Documento(); oDoc.Id = itemSD.Id_documento; oDocMng.O_Documento = oDoc; oDocMng.selById(); itemSD.PDocumento = oDoc; } //Salida compartida oS.PLstSalComp = new List <Salida_compartida>(); foreach (ListItem liPC in lst_pedimentos_consolidados.Items) { Salida_compartida oSC = new Salida_compartida(); oSC.Referencia = liPC.Value; oSC.Id_usuario = oS.PUsuario.Id; oS.PLstSalComp.Add(oSC); } //Vigilante oS.Vigilante = ddlVigilante.SelectedItem.Text.Trim(); //Bodega Bodega oB = new Bodega(); oB.Id = Convert.ToInt32(ddlBodega.SelectedValue); BodegaMng oBMng = new BodegaMng(); oBMng.O_Bodega = oB; oBMng.selById(); oS.PBodega = oB; //Cortina Cortina oCor = new Cortina(); oCor.Id = oS.Id_cortina; oCor.Nombre = ddlCortina.SelectedItem.Text; oCor.Id_bodega = oS.Id_bodega; oS.PCortina = oCor; //Cliente oS.PCliente = CatalogCtrl.Cliente_GetById(oS.Id_cliente); //Transporte Transporte oT = new Transporte(); oT.Id = oS.Id_transporte; oT.Nombre = ddlTransporte.SelectedItem.Text; oS.PTransporte = oT; //Transporte tipo Transporte_tipo oTT = new Transporte_tipo(); oTT.Id = oS.Id_transporte_tipo; oTT.Nombre = ddlTipo_Transporte.SelectedItem.Text; oS.PTransporteTipo = oTT; //Custodia Custodia oCdia = new Custodia(); oCdia.Id = oS.Id_custodia; oCdia.Nombre = ddlCustodia.SelectedItem.Text; oS.PCustodia = oCdia; return(oS); }
private Salida addSalidaValuesCompartida() { Salida oS = new Salida(); oS.Folio = hfFolio.Value.ToString(); try { oS = getSalidaCompartida(oS.Folio); setFormValuesCompartida(oS); SalidaCtrl.AddSalidaCompartida(oS); oS.PUsuario = ((MstCasc)this.Master).getUsrLoged(); DocumentoMng oDocMng = new DocumentoMng(); foreach (Salida_documento itemSD in VSLstSD) { Documento oDoc = new Documento(); oDoc.Id = itemSD.Id_documento; oDocMng.O_Documento = oDoc; oDocMng.selById(); itemSD.PDocumento = oDoc; } oS.PLstSalDoc = VSLstSD; Bodega oB = new Bodega(); oB.Id = oS.Id_bodega; BodegaMng oBMng = new BodegaMng(); oBMng.O_Bodega = oB; oBMng.selById(); oS.PBodega = oB; Cortina oCor = new Cortina(); oCor.Id = oS.Id_cortina; oCor.Nombre = ddlCortina.SelectedItem.Text; oCor.Id_bodega = oS.Id_bodega; oS.PCortina = oCor; Cliente oC = CatalogCtrl.Cliente_GetById(oS.Id_cliente); oS.PCliente = oC; Cuenta_tipoMng oCTMng = new Cuenta_tipoMng(); Cuenta_tipo oCT = new Cuenta_tipo(); oCT.Id = oC.Id_cuenta_tipo; oCTMng.O_Cuenta_tipo = oCT; oCTMng.selById(); oS.PCliente.cuenta_tipo = oCT.Nombre; Transporte oT = new Transporte(); oT.Id = oS.Id_transporte; oT.Nombre = ddlTransporte.SelectedItem.Text; oS.PTransporte = oT; Transporte_tipo oTT = new Transporte_tipo(); oTT.Id = oS.Id_transporte_tipo; oTT.Nombre = ddlTipo_Transporte.SelectedItem.Text; oS.PTransporteTipo = oTT; Custodia oCdia = new Custodia(); oCdia.Id = oS.Id_custodia; oCdia.Nombre = ddlCustodia.SelectedItem.Text; oS.PCustodia = oCdia; } catch { throw; } return(oS); }