public static void TJ_TejeduriaRutaProces_mnt01(ETejeduria_DetProces TJDP) { DBAccess db = new DBAccess(); db.AddParameter("@pidPeriodo", TJDP.IdPeriodo); db.AddParameter("@pid_producto", TJDP.Id_producto); db.AddParameter("@pidEmpresa", TJDP.IdEmpresa); db.AddParameter("@pnu_correficha", TJDP.Nu_correficha); db.AddParameter("@pidItem", TJDP.IdItem); db.AddParameter("@pidRutaProces", TJDP.IdRutaProces); db.AddParameter("@pid_ucrearec", TJDP.Id_ucrearec); db.ExecuteNonQuery("TJ_TejeduriaRutaProces_mnt01"); }
public static List<ETejeduria_DetProces> TJ_TejeduriaDetProces_qry07(ETejeduria_DetProces oTJ) { DBAccess db = new DBAccess(); //db.AddParameter("@pidPeriodo", oTJ.IdPeriodo); db.AddParameter("@pidEmpresa", oTJ.IdEmpresa); db.AddParameter("@pid_producto", oTJ.Id_producto); db.AddParameter("@pnu_correficha", oTJ.Nu_correficha); List<ETejeduria_DetProces> result = new List<ETejeduria_DetProces>(); using (IDataReader rd = db.ExecuteReader("TJ_TejeduriaRutaProces_qry02")) { while (rd.Read()) { result.Add(mCargarTJD(rd)); } } return result; }
public static void TJ_TejeduriaRutaProces_mnt03(ETejeduria_DetProces TJDP) { DTejeduriaDetProces.TJ_TejeduriaRutaProces_mnt03(TJDP); }
public static List<ETejeduria_DetProces> mListarTejeduriaDetProces(ETejeduria_DetProces oTJD) { return DTejeduriaDetProces.TJ_TejeduriaDetProces_qry07(oTJD); }
private void BuscarTejeduria() { ETejeduria oT = new ETejeduria(); dgProcesos.Rows.Clear(); oT.IdEmpresa = wfChgEmpPer.datos.idEmpresa; oT.Id_producto = txt_idTejido.Text; oT.Nu_correficha = txt_nuFicha.Text; List<ETejeduria> oListDato = BTejeduria.TJ_Tejeduria_qry06(oT); string val = oListDato[0].existe; if (val == "0") { try { ETejeduria oTJ = new ETejeduria(); oTJ.IdEmpresa = wfChgEmpPer.datos.idEmpresa; oTJ.Id_producto = txt_idTejido.Text; oTJ.Nu_correficha = txt_nuFicha.Text; oTJ.Nu_tf = txt_nuTf.Text; oTJ.Nu_tfref = TfRef; ETejeduria oBtieneTJ = new ETejeduria(); oBtieneTJ = BTejeduria.TJ_Tejeduria_qry07(oTJ); lbl_dsTejido.Text = oBtieneTJ.ds_producto.ToString().Trim(); txt_fecha.Text = oBtieneTJ.Fe_registro.ToString(); txt_IdCli.Text = oBtieneTJ.Id_clipro.ToString().Trim(); lbl_dsCliente.Text = oBtieneTJ.ds_razonSoc.ToString().Trim(); ETejeduria_DetProces oTJDP = new ETejeduria_DetProces(); oTJDP.IdEmpresa = wfChgEmpPer.datos.idEmpresa; oTJDP.Id_producto = txt_idTejido.Text; oTJDP.Nu_correficha =txt_nuFicha.Text; List<ETejeduria_DetProces> lstTJP = new List<ETejeduria_DetProces>(); lstTJP = BTejeduriaDetProces.mListarTejeduriaDetProces(oTJDP); foreach (ETejeduria_DetProces objTJDP in lstTJP) { string[] row = { objTJDP.IdItem.ToString(), objTJDP.IdRutaProces.ToString(), }; dgProcesos.Rows.Add(row); } } catch (Exception ex) { ex.ToString(); } } else { MessageBox.Show("Datos no existen", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private static ETejeduria_DetProces mCargarTJD(System.Data.IDataReader rdr) { ETejeduria_DetProces oTJ = new ETejeduria_DetProces(); //oTJ.Id_producto = rdr.IsDBNull(rdr.GetOrdinal("id_producto")) ? String.Empty : rdr.GetString(rdr.GetOrdinal("id_producto")); //oTJ.Nu_correficha = rdr.IsDBNull(rdr.GetOrdinal("nu_correficha")) ? String.Empty : rdr.GetString(rdr.GetOrdinal("nu_correficha")); //oTJ.Nu_secuen = rdr.IsDBNull(rdr.GetOrdinal("nu_secuen")) ? String.Empty : rdr.GetString(rdr.GetOrdinal("nu_secuen")); oTJ.IdItem = rdr.IsDBNull(rdr.GetOrdinal("idItem")) ? String.Empty : rdr.GetString(rdr.GetOrdinal("idItem")); oTJ.IdRutaProces = rdr.IsDBNull(rdr.GetOrdinal("idRutaProces")) ? String.Empty : rdr.GetString(rdr.GetOrdinal("idRutaProces")); return oTJ; }
private void Grabar() { DialogResult result = MessageBox.Show("Seguro que desea Grabar?", "Grabar", MessageBoxButtons.OKCancel, MessageBoxIcon.Information); { if (result == DialogResult.OK) { ETejeduria tj = new ETejeduria(); tj.IdEmpresa = wfChgEmpPer.datos.idEmpresa;//wfChgEmpPer.datos.idEmpresa;//llenar con sesion DateTime periodo = DateTime.Parse(txt_fecha.Text); tj.IdPeriodo = periodo.Year.ToString(); tj.Id_producto = txt_idTejido.Text; tj.Nu_correficha = txt_nuFicha.Text; tj.Id_clipro = txt_IdCli.Text; tj.Qt_anchacaba = Convert.ToDecimal(txt_InfTecAcab_ancho.Text); tj.Qt_densacaba = Convert.ToDecimal(txt_InfTecAcab_desnsi.Text); tj.Qt_rendacaba = Convert.ToDecimal(txt_InfTecAcab_rendim.Text); tj.Id_maqtenido = txt_maq_teñido.Text; tj.Nu_porencla = Convert.ToDecimal(txt_encogi_largo.Text); tj.Nu_porencan = Convert.ToDecimal(txt_encog_ancho.Text); tj.Id_uupdarec = frmLogin.d.id.ToLower();//frmLogin.d.id.ToLower();//LLENAR DESDE LA SESION tj.Id_Color = txtIdColor.Text; BTejeduria.TJ_Tejeduria_mnt04(tj); //detalle tejeduria proceso ETejeduria_DetProces TJDP = new ETejeduria_DetProces(); for (int i = 0; dgProcesos.Rows.Count > i; i++) { var idItem = dgProcesos.Rows[i].Cells["idItem"].Value; var idRutaProces = dgProcesos.Rows[i].Cells["idRutaProces"].Value; TJDP.IdPeriodo = periodo.Year.ToString(); //wfChgEmpPer.datos.idperiodo;//llenar con sesion TJDP.Id_producto = txt_idTejido.Text; TJDP.IdEmpresa = wfChgEmpPer.datos.idEmpresa; TJDP.Nu_correficha = txt_nuFicha.Text; TJDP.IdItem = idItem.ToString(); TJDP.IdRutaProces = idRutaProces.ToString(); TJDP.Id_ucrearec = frmLogin.d.id.ToLower(); //frmLogin.d.id; //llenar con sesion BTejeduriaDetProces.TJ_TejeduriaRutaProces_mnt01(TJDP); } //ANULAR EL DETALLE DEL PROCESO ETejeduria_DetProces TJDPE = new ETejeduria_DetProces(); for (int i = 0; dgTempDetProc.Rows.Count > i; i++) { var nu_Item = dgTempDetProc.Rows[i].Cells["nuItem"].Value; TJDPE.IdPeriodo = periodo.Year.ToString(); TJDPE.Id_producto = txt_idTejido.Text; TJDPE.IdEmpresa = wfChgEmpPer.datos.idEmpresa; //wfChgEmpPer.datos.idperiodo;//llenar con sesion TJDPE.Nu_correficha = txt_nuFicha.Text; TJDPE.IdItem = nu_Item.ToString(); TJDPE.Id_ucrearec = frmLogin.d.id.ToLower(); BTejeduriaDetProces.TJ_TejeduriaRutaProces_mnt03(TJDPE); } MessageBox.Show("Datos Grabados", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information); } else if (result == DialogResult.Cancel) { } } }
private void BuscarTejeduria() { ETejeduria oT = new ETejeduria(); //oT.IdPeriodo = "2014"; dgProcesos.Rows.Clear(); dgTempDetProc.Rows.Clear(); oT.IdEmpresa = wfChgEmpPer.datos.idEmpresa; oT.Id_producto = txtBuscarTejido.Text; oT.Nu_correficha = txtBuscarFicha.Text; List<ETejeduria> oListDato = BTejeduria.TJ_Tejeduria_qry06(oT); string val = oListDato[0].existe; if (val == "0") { try { ETejeduria oTJ = new ETejeduria(); //oTJ.IdPeriodo = "2014"; oTJ.IdEmpresa = wfChgEmpPer.datos.idEmpresa; oTJ.Id_producto = txtBuscarTejido.Text; oTJ.Nu_correficha = txtBuscarFicha.Text; oTJ.Nu_tf = txtBuscarnuTF.Text; oTJ.Nu_tfref = txtBuscarTfRef.Text; ETejeduria oBtieneTJ = new ETejeduria(); oBtieneTJ = BTejeduria.TJ_Tejeduria_qry07(oTJ); txt_idTejido.Text = oBtieneTJ.Id_producto.ToString().Trim(); txt_nuFicha.Text = oBtieneTJ.Nu_correficha.ToString().Trim(); lbl_dsTejido.Text = oBtieneTJ.ds_producto.ToString().Trim(); txt_fecha.Text = oBtieneTJ.Fe_registro.ToString(); txt_IdCli.Text = oBtieneTJ.Id_clipro.ToString().Trim(); lbl_dsCliente.Text = oBtieneTJ.ds_razonSoc.ToString().Trim(); txt_nuTf.Text = oBtieneTJ.Nu_tf.ToString().Trim(); txt_maq_teñido.Text = oBtieneTJ.Id_maqtenido.ToString().Trim(); txt_encogi_largo.Text = oBtieneTJ.Nu_porencla.ToString().Trim(); txt_encog_ancho.Text = oBtieneTJ.Nu_porencan.ToString().Trim(); //txt_rev_porc.Text = oBtieneTJ.Nu_porrev.ToString().Trim(); //txt_merma_porc.Text = oBtieneTJ.Nu_pormerma.ToString().Trim(); txt_InfTecAcab_ancho.Text = oBtieneTJ.Qt_anchacaba.ToString(); txt_InfTecAcab_desnsi.Text = oBtieneTJ.Qt_densacaba.ToString(); txt_InfTecAcab_rendim.Text = oBtieneTJ.Qt_rendacaba.ToString(); //txt_costo_teñido.Text = oBtieneTJ.Mt_costtenido.ToString().Trim(); //txtMaquina.Text = oBtieneTJ.Id_ptmaq.ToString().Trim(); //txtdiam.Text = oBtieneTJ.Nu_ptdiame.ToString(); //txtpeso.Text = oBtieneTJ.Qt_ptpeso.ToString(); //txtgalga.Text = oBtieneTJ.Nu_ptgalga.ToString(); //txtsistTrab.Text = oBtieneTJ.Nu_ptsistrab.ToString(); //txtsistAnul.Text = oBtieneTJ.Nu_ptsisanul.ToString(); //txtrpm.Text = oBtieneTJ.Nu_ptrpm.ToString(); //txtReqAcabAnch.Text = oBtieneTJ.qt_anchdatreqacaba.ToString(); //txtReqAcabDens.Text = oBtieneTJ.qt_densdatreqacaba.ToString(); //txtPlatina.Text = oBtieneTJ.nu_platina.ToString(); txtIdColor.Text = oBtieneTJ.Id_Color.ToString(); lblColor.Text = oBtieneTJ.ds_Color.ToString(); //txt_observ.Text = oBtieneTJ.Ds_observa.ToString(); /// detalle de procesos de tejeduria ETejeduria_DetProces oTJDP = new ETejeduria_DetProces(); oTJDP.IdEmpresa = wfChgEmpPer.datos.idEmpresa; oTJDP.Id_producto = txtBuscarTejido.Text; oTJDP.Nu_correficha = txtBuscarFicha.Text; List<ETejeduria_DetProces> lstTJP = new List<ETejeduria_DetProces>(); lstTJP = BTejeduriaDetProces.mListarTejeduriaDetProces(oTJDP); foreach (ETejeduria_DetProces objTJDP in lstTJP) { string[] row = { objTJDP.IdItem.ToString(), objTJDP.IdRutaProces.ToString(), }; dgProcesos.Rows.Add(row); } } catch (Exception ex) { ex.ToString(); } } else { MessageBox.Show("Datos no existen", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void Grabar() { DialogResult result = MessageBox.Show("Seguro que desea Grabar?", "Grabar", MessageBoxButtons.OKCancel, MessageBoxIcon.Information); { if (result == DialogResult.OK) { ETejeduria tj = new ETejeduria(); tj.IdEmpresa = wfChgEmpPer.datos.idEmpresa; //wfChgEmpPer.datos.idEmpresa;//llenar con sesion DateTime periodo = DateTime.Parse(txt_fecha.Text); tj.IdPeriodo = periodo.Year.ToString(); tj.Id_producto = txt_idTejido.Text; if (txt_nuFicha.Text == "") { List<Dato> oListDato = BTejeduria.TJ_TejeduriaGenCod( wfChgEmpPer.datos.idEmpresa,txt_idTejido.Text); if (oListDato.Count > 0) { txt_nuFicha.Text = oListDato[0].id; tj.Nu_correficha = txt_nuFicha.Text; } } else { tj.Nu_correficha = txt_nuFicha.Text; } tj.Id_clipro = txt_IdCli.Text; tj.Fe_registro = txt_fecha.Text; tj.Nu_refmuestra = txt_nuMuestra.Text; tj.Nu_tf = txt_nuTf.Text; tj.Nu_gt = txt_Nu_GT.Text; tj.Nu_tfref = txt_nu_tfref.Text; tj.Id_vtipmcdo = cb_Mercado.SelectedValue.ToString(); tj.Nu_regula = txt_Nu_Regulacion.Text; tj.Id_vdestino = cb_Destino.SelectedValue.ToString(); tj.Id_vtipancru = cb_InfTecCrudo_ancho.SelectedValue.ToString(); tj.Qt_anchcrudo = Convert.ToDecimal(txt_InfTecCrudo_idancho.Text); tj.Qt_denscrudo = Convert.ToDecimal(txt_InfTecCrudo_densidad.Text); tj.Qt_rendcrudo = Convert.ToDecimal(txt_InfTecCrudo_rendim.Text); tj.Qt_anchacaba = Convert.ToDecimal(txt_InfTecAcab_ancho.Text); tj.Qt_densacaba = Convert.ToDecimal(txt_InfTecAcab_desnsi.Text); tj.Qt_rendacaba = Convert.ToDecimal(txt_InfTecAcab_rendim.Text); tj.Id_maqtenido = txt_maq_teñido.Text; tj.Nu_porencla = Convert.ToDecimal(txt_encogi_largo.Text); tj.Nu_porencan = Convert.ToDecimal(txt_encog_ancho.Text); tj.Ds_observa = txt_observ.Text; tj.Id_ptmaq = txtMaquina.Text; tj.Nu_ptdiame = Convert.ToDecimal(txtdiam.Text); tj.Nu_ptgalga = Convert.ToInt16(txtgalga.Text); tj.Nu_ptsistrab = Convert.ToInt16(txtsistTrab.Text); tj.Nu_ptsisanul = Convert.ToInt16(txtsistAnul.Text); tj.Nu_ptrpm = Convert.ToInt16(txtrpm.Text); tj.Qt_ptpeso = Convert.ToDecimal(txtpeso.Text); tj.Ds_obstejido = txtDs_obstejido.Text.ToUpper(); tj.Ds_evadeftj = txtDs_evadeftj.Text.ToUpper(); tj.Nu_porrev = Convert.ToDecimal(txt_rev_porc.Text); tj.Nu_gradosrev = Convert.ToDecimal("0.0000") ; tj.Nu_pormerma = Convert.ToDecimal(txt_merma_porc.Text); tj.Mt_costtenido = Convert.ToDecimal(txt_costo_teñido.Text); tj.Mt_totconsumo = Convert.ToDecimal("0.0000"); tj.nu_platina = Convert.ToDecimal(txtPlatina.Text); tj.qt_anchdatreqacaba = Convert.ToDecimal(txtReqAcabAnch.Text); tj.qt_densdatreqacaba = Convert.ToDecimal(txtReqAcabDens.Text); tj.Id_ucrearec = frmLogin.d.id.ToLower();//frmLogin.d.id.ToLower();//LLENAR DESDE LA SESION tj.Id_Color = txtIdColor.Text; BTejeduria.TJ_Tejeduria_mnt02(tj); //-----------------DETALLE 1 DE TEJIDO---------------- ETejeduriaDet TJD = new ETejeduriaDet(); for (int i = 0; dgDetalle.Rows.Count > i; i++) { var nusecu = dgDetalle.Rows[i].Cells["_nu_secuen"].Value; var Alim = dgDetalle.Rows[i].Cells["Alim"].Value; var Distribucion = dgDetalle.Rows[i].Cells["Distribucion"].Value; var estructura = dgDetalle.Rows[i].Cells["estructura"].Value; var idHilo = dgDetalle.Rows[i].Cells["idHilo"].Value; var Hilo = dgDetalle.Rows[i].Cells["Hilo"].Value; var tipo_fibra = dgDetalle.Rows[i].Cells["tipo_fibra"].Value; var carac_hilo = dgDetalle.Rows[i].Cells["carac_hilo"].Value; var titulo = dgDetalle.Rows[i].Cells["titulo"].Value; var idLustre = dgDetalle.Rows[i].Cells["idLustre"].Value; var lustre = dgDetalle.Rows[i].Cells["lustre"].Value; var torsion = dgDetalle.Rows[i].Cells["nu_torsion"].Value; var idProv = dgDetalle.Rows[i].Cells["idProv"].Value; var proveedor = dgDetalle.Rows[i].Cells["proveedor"].Value; var Lote = dgDetalle.Rows[i].Cells["Lote"].Value; var etiqueta = dgDetalle.Rows[i].Cells["etiqueta"].Value; var porHiloCrudo = dgDetalle.Rows[i].Cells["porHiloCrudo"].Value; var porHiloAcab = dgDetalle.Rows[i].Cells["porHiloAcab"].Value; var nu_tension = dgDetalle.Rows[i].Cells["nu_tension"].Value; var nu_bobinas = dgDetalle.Rows[i].Cells["nu_bobinas"].Value; var nu_aliment = dgDetalle.Rows[i].Cells["nu_aliment"].Value; var pre_uni = dgDetalle.Rows[i].Cells["pre_uni"].Value; var Sub_total = dgDetalle.Rows[i].Cells["Sub_total"].Value; TJD.IdEmpresa = wfChgEmpPer.datos.idEmpresa; TJD.IdPeriodo = periodo.Year.ToString(); //wfChgEmpPer.datos.idperiodo;//llenar con sesion TJD.Id_producto = txt_idTejido.Text; TJD.Nu_correficha= txt_nuFicha.Text; TJD.Nu_secuen = nusecu.ToString(); TJD.Id_numalim = Alim.ToString(); TJD.Ds_distrib = Distribucion.ToString(); TJD.Ds_estruct = estructura.ToString(); TJD.Id_prodhilo = idHilo.ToString(); TJD.ds_prodhilo = Hilo.ToString(); TJD.Ds_tipfibra = tipo_fibra.ToString(); TJD.Ds_carachilo = carac_hilo.ToString(); TJD.Ds_titulo = titulo.ToString(); TJD.Id_vlustre = idLustre.ToString(); TJD.ds_lustre = lustre.ToString(); TJD.Nu_torsion = torsion.ToString(); TJD.Id_clipro = idProv.ToString(); TJD.ds_razsoc = proveedor.ToString(); TJD.Nu_lote = Lote.ToString(); TJD.Ds_etiqueta = etiqueta.ToString(); TJD.Nu_porhilo = Convert.ToDecimal(porHiloCrudo); TJD.Nu_porhiloaca= Convert.ToDecimal(porHiloAcab); TJD.Nu_longmalla = Convert.ToDecimal("0.0000"); TJD.Nu_tension = Convert.ToDecimal(nu_tension); TJD.Nu_bobinas = Convert.ToInt16(nu_bobinas); TJD.Nu_alimenta = Convert.ToInt16(nu_aliment); TJD.Mt_preuni = Convert.ToDecimal(pre_uni); TJD.Mt_subtotcon = Convert.ToDecimal(Sub_total); TJD.Id_ucrearec = frmLogin.d.id.ToLower(); //frmLogin.d.id; //llenar con sesion BTejeduriaDet.TJ_TejeduriaDet_mnt01(TJD); } //detalle tejeduria proceso ETejeduria_DetProces TJDP = new ETejeduria_DetProces(); for (int i = 0; dgProcesos.Rows.Count > i; i++) { var idItem = dgProcesos.Rows[i].Cells["idItem"].Value; var idRutaProces = dgProcesos.Rows[i].Cells["idRutaProces"].Value; TJDP.IdPeriodo = periodo.Year.ToString(); //wfChgEmpPer.datos.idperiodo;//llenar con sesion TJDP.Id_producto = txt_idTejido.Text; TJDP.IdEmpresa = wfChgEmpPer.datos.idEmpresa; TJDP.Nu_correficha = txt_nuFicha.Text; TJDP.IdItem = idItem.ToString(); TJDP.IdRutaProces = idRutaProces.ToString(); TJDP.Id_ucrearec = frmLogin.d.id.ToLower(); //frmLogin.d.id; //llenar con sesion BTejeduriaDetProces.TJ_TejeduriaRutaProces_mnt01(TJDP); } // Detalle Tejeduria Malla ETejeduria_DetMall TJDPLM = new ETejeduria_DetMall(); for (int i = 0; dgTJLM.Rows.Count > i; i++) { var nu_secue = dgTJLM.Rows[i].Cells["nu_secuen"].Value; var idItem = dgTJLM.Rows[i].Cells["nu_item"].Value; var nulongMall = dgTJLM.Rows[i].Cells["nu_longmalla"].Value; var stAnaulado = dgTJLM.Rows[i].Cells["_st_anulado"].Value; TJDPLM.IdEmpresa = wfChgEmpPer.datos.idEmpresa; //wfChgEmpPer.datos.idperiodo;//llenar con sesion TJDPLM.IdPeriodo = periodo.Year.ToString(); TJDPLM.Id_producto = txt_idTejido.Text; TJDPLM.Nu_correficha = txt_nuFicha.Text; TJDPLM.Nu_secuen = nu_secue.ToString(); TJDPLM.Nu_item = idItem.ToString(); TJDPLM.Nu_longmalla = Convert.ToDecimal(nulongMall); TJDPLM.Id_ucrearec = frmLogin.d.id.ToLower(); //frmLogin.d.id; //llenar con sesion TJDPLM.St_anulado = stAnaulado.ToString(); BTejeduriaDetMall.TJ_Tejeduria_DetMall_mnt01(TJDPLM); } //ANULAR EL DETALLE ETejeduriaDet TJDPLME = new ETejeduriaDet(); for (int i = 0; dgTempDet.Rows.Count > i; i++) { var nu_secue = dgTempDet.Rows[i].Cells["nusecuencia"].Value; TJDPLME.IdPeriodo = periodo.Year.ToString(); TJDPLME.IdEmpresa = wfChgEmpPer.datos.idEmpresa; //wfChgEmpPer.datos.idperiodo;//llenar con sesion TJDPLME.Id_producto = txt_idTejido.Text; TJDPLME.Nu_correficha = txt_nuFicha.Text; TJDPLME.Nu_secuen = nu_secue.ToString(); TJDPLME.Id_ucrearec = frmLogin.d.id.ToLower(); BTejeduriaDet.TJ_TejeduriaDet_mnt03(TJDPLME); } //ANULAR EL DETALLE DEL PROCESO ETejeduria_DetProces TJDPE = new ETejeduria_DetProces(); for (int i = 0; dgTempDetProc.Rows.Count > i; i++) { var nu_Item = dgTempDetProc.Rows[i].Cells["nuItem"].Value; TJDPE.IdPeriodo = periodo.Year.ToString(); TJDPE.Id_producto = txt_idTejido.Text; TJDPE.IdEmpresa = wfChgEmpPer.datos.idEmpresa; //wfChgEmpPer.datos.idperiodo;//llenar con sesion TJDPE.Nu_correficha = txt_nuFicha.Text; TJDPE.IdItem = nu_Item.ToString(); TJDPE.Id_ucrearec = frmLogin.d.id.ToLower(); BTejeduriaDetProces.TJ_TejeduriaRutaProces_mnt03(TJDPE); } MessageBox.Show("Datos Grabados","Información" ,MessageBoxButtons.OK, MessageBoxIcon.Information); } else if (result == DialogResult.Cancel) { } } }
private void BuscarTejeduria() { ETejeduria oT = new ETejeduria(); //oT.IdPeriodo = "2014"; oT.IdEmpresa = wfChgEmpPer.datos.idEmpresa; oT.Id_producto = txtBuscarTejido.Text; oT.Nu_correficha = txtBuscarFicha.Text; List<ETejeduria> oListDato = BTejeduria.TJ_Tejeduria_qry06(oT); string val = oListDato[0].existe; if (val == "0") { try { dgDetalle.Rows.Clear(); dgTJLM.Rows.Clear(); dgTempDet.Rows.Clear(); dgProcesos.Rows.Clear(); dgTempDetProc.Rows.Clear(); ETejeduria oTJ = new ETejeduria(); //oTJ.IdPeriodo = "2014"; oTJ.IdEmpresa = wfChgEmpPer.datos.idEmpresa; oTJ.Id_producto = txtBuscarTejido.Text; oTJ.Nu_correficha = txtBuscarFicha.Text; oTJ.Nu_tf = txtBuscarnuTF.Text; oTJ.Nu_tfref = txtBuscarTfRef.Text; ETejeduria oBtieneTJ = new ETejeduria(); oBtieneTJ = BTejeduria.TJ_Tejeduria_qry07(oTJ); txt_idTejido.Text = oBtieneTJ.Id_producto.ToString().Trim(); txt_nuFicha.Text = oBtieneTJ.Nu_correficha.ToString().Trim(); lbl_dsTejido.Text = oBtieneTJ.ds_producto.ToString().Trim(); txt_fecha.Text = oBtieneTJ.Fe_registro.ToString(); txt_IdCli.Text = oBtieneTJ.Id_clipro.ToString().Trim(); lbl_dsCliente.Text = oBtieneTJ.ds_razonSoc.ToString().Trim(); txt_nuMuestra.Text = oBtieneTJ.Nu_refmuestra.ToString().Trim(); txt_nuTf.Text = oBtieneTJ.Nu_tf.ToString().Trim(); txt_Nu_GT.Text = oBtieneTJ.Nu_gt.ToString(); txt_nu_tfref.Text = oBtieneTJ.Nu_tfref.ToString().Trim(); txt_idMercado.Text = oBtieneTJ.Id_vtipmcdo.ToString().Trim(); cb_Mercado.SelectedValue = txt_idMercado.Text; txt_Nu_Regulacion.Text = oBtieneTJ.Nu_regula.ToString().Trim(); txt_IdDestino.Text = oBtieneTJ.Id_vdestino.ToString().Trim(); cb_Destino.SelectedValue = txt_IdDestino.Text; txt_InfTecCrudo_idancho.Text = oBtieneTJ.Id_vtipancru.ToString().Trim(); cb_InfTecCrudo_ancho.SelectedValue = txt_InfTecCrudo_idancho.Text; txt_infTecCruda_cant.Text = oBtieneTJ.Qt_anchcrudo.ToString().Trim(); txt_InfTecCrudo_densidad.Text = oBtieneTJ.Qt_denscrudo.ToString().Trim(); txt_InfTecCrudo_rendim.Text = oBtieneTJ.Qt_rendcrudo.ToString().Trim(); txt_InfTecAcab_ancho.Text = oBtieneTJ.Qt_anchacaba.ToString().Trim(); txt_InfTecAcab_desnsi.Text = oBtieneTJ.Qt_densacaba.ToString().Trim(); txt_InfTecAcab_rendim.Text = oBtieneTJ.Qt_rendacaba.ToString().Trim(); txt_maq_teñido.Text = oBtieneTJ.Id_maqtenido.ToString().Trim(); txt_encogi_largo.Text = oBtieneTJ.Nu_porencla.ToString().Trim(); txt_encog_ancho.Text = oBtieneTJ.Nu_porencan.ToString().Trim(); txt_rev_porc.Text = oBtieneTJ.Nu_porrev.ToString().Trim(); txt_merma_porc.Text = oBtieneTJ.Nu_pormerma.ToString().Trim(); txt_costo_teñido.Text = oBtieneTJ.Mt_costtenido.ToString().Trim(); txtMaquina.Text = oBtieneTJ.Id_ptmaq.ToString().Trim(); txtdiam.Text = oBtieneTJ.Nu_ptdiame.ToString(); txtpeso.Text = oBtieneTJ.Qt_ptpeso.ToString(); txtgalga.Text = oBtieneTJ.Nu_ptgalga.ToString(); txtsistTrab.Text = oBtieneTJ.Nu_ptsistrab.ToString(); txtsistAnul.Text = oBtieneTJ.Nu_ptsisanul.ToString(); txtrpm.Text = oBtieneTJ.Nu_ptrpm.ToString(); txtReqAcabAnch.Text = oBtieneTJ.qt_anchdatreqacaba.ToString(); txtReqAcabDens.Text = oBtieneTJ.qt_densdatreqacaba.ToString(); txtPlatina.Text = oBtieneTJ.nu_platina.ToString(); txtIdColor.Text = oBtieneTJ.Id_Color.ToString(); lblColor.Text = oBtieneTJ.ds_Color.ToString(); txt_observ.Text = oBtieneTJ.Ds_observa.ToString(); txtDs_obstejido.Text = oBtieneTJ.Ds_obstejido.ToString(); txtDs_evadeftj.Text = oBtieneTJ.Ds_evadeftj.ToString(); ///detalle de tejeduria ETejeduriaDet oTJD = new ETejeduriaDet(); //oTJD.IdPeriodo = "2014"; oTJD.IdEmpresa = wfChgEmpPer.datos.idEmpresa; ; oTJD.Id_producto = txtBuscarTejido.Text; oTJD.Nu_correficha = txtBuscarFicha.Text; List<ETejeduriaDet> lstoc = new List<ETejeduriaDet>(); lstoc = BTejeduriaDet.mListarTejeduriaDet(oTJD); foreach (ETejeduriaDet objTJD in lstoc) { string[] row = { objTJD.Nu_secuen.ToString(), objTJD.Id_numalim.ToString(), objTJD.Ds_distrib, objTJD.Ds_estruct, objTJD.Id_prodhilo, objTJD.ds_prodhilo, objTJD.Ds_tipfibra, objTJD.Ds_carachilo, objTJD.Ds_titulo, objTJD.Id_vlustre, objTJD.ds_lustre, objTJD.Nu_torsion, objTJD.Id_clipro, objTJD.ds_razsoc, objTJD.Nu_lote, objTJD.Ds_etiqueta, objTJD.Nu_porhilo.ToString(), objTJD.Nu_porhiloaca.ToString(), objTJD.Nu_tension.ToString(), objTJD.Nu_bobinas.ToString(), objTJD.Nu_alimenta.ToString(), objTJD.Mt_preuni.ToString(), objTJD.Mt_subtotcon.ToString(), }; dgDetalle.Rows.Add(row); } /// detalle de procesos de tejeduria ETejeduria_DetProces oTJDP = new ETejeduria_DetProces(); //oTJDP.IdPeriodo = "2014"; oTJDP.IdEmpresa = wfChgEmpPer.datos.idEmpresa; ; oTJDP.Id_producto = txtBuscarTejido.Text; oTJDP.Nu_correficha = txtBuscarFicha.Text; //List<ETejeduria_DetProces> lsTJP = new List<ETejeduria_DetProces>(); List<ETejeduria_DetProces> lstTJP = new List<ETejeduria_DetProces>(); lstTJP = BTejeduriaDetProces.mListarTejeduriaDetProces(oTJDP); foreach (ETejeduria_DetProces objTJDP in lstTJP) { string[] row = { objTJDP.IdItem.ToString(), objTJDP.IdRutaProces.ToString(), }; dgProcesos.Rows.Add(row); } //dgProcesos.DataSource = BTejeduriaDetProces.mListarTejeduriaDetProces(oTJDP); /// Detalle de longitud malla ETejeduria_DetMall oTJDM = new ETejeduria_DetMall(); //oTJDM.IdPeriodo = "2014"; oTJDM.IdEmpresa = wfChgEmpPer.datos.idEmpresa; oTJDM.Id_producto =txt_idTejido.Text; oTJDM.Nu_correficha =txt_nuFicha.Text; //dgTJLM.DataSource = BTejeduriaDetMall.mListarTejeduriaDetMall(oTJDM); List<ETejeduria_DetMall> lstTJ = new List<ETejeduria_DetMall>(); lstTJ = BTejeduriaDetMall.mListarTejeduriaDetMall(oTJDM); foreach (ETejeduria_DetMall objTJDM in lstTJ) { string[] row = { objTJDM.Nu_secuen.ToString(), objTJDM.Nu_item.ToString(), objTJDM.Nu_longmalla.ToString(), objTJDM.St_anulado.ToString(), }; dgTJLM.Rows.Add(row); } } catch (Exception ex) { ex.ToString(); } } else { MessageBox.Show("Datos no existen", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Error); Nuevo(); } }
private void mSalvarDatosGrilla() { try { //recorre la cantidad de items, por cada item la entidad oAsigHorario va almacenando , //esto para que data que se va ingresando en la grilla no se pierda List<ETejeduria_DetProces> lstSalvarDatos = new List<ETejeduria_DetProces>(); for (int i = 0; dgProcesos.Rows.Count > i; i++) { // la entidad almacena los items de la grilla ETejeduria_DetProces oTJ = new ETejeduria_DetProces(); // verificar si los valores ingresados en la grilla estan en label o texbox como tambien en un dropdowlinst oTJ.IdItem = dgProcesos.Rows[i].Cells["idItem"].Value.ToString(); oTJ.IdRutaProces = dgProcesos.Rows[i].Cells["idRutaProces"].Value.ToString(); //añade los valores de la entidad a la lista de la entidad lstSalvarDatos.Add(oTJ); } // se crea una sesion para almacenar la lista que contiene los datos. SalvarDatos = lstSalvarDatos; } catch (Exception ex) { ex.ToString(); } }