private static ETejeduria_DetMall mCargarTJD(IDataReader rdr) { ETejeduria_DetMall oTJ = new ETejeduria_DetMall(); //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.Nu_item = rdr.IsDBNull(rdr.GetOrdinal("nu_item")) ? String.Empty : rdr.GetString(rdr.GetOrdinal("nu_item")); oTJ.Nu_longmalla = rdr.IsDBNull(rdr.GetOrdinal("nu_longmalla")) ? 0 : rdr.GetDecimal(rdr.GetOrdinal("nu_longmalla")); oTJ.St_anulado = rdr.IsDBNull(rdr.GetOrdinal("st_anulado")) ? String.Empty : rdr.GetString(rdr.GetOrdinal("st_anulado")); return oTJ; }
public static void TJ_Tejeduria_DetMall_mnt01(ETejeduria_DetMall TJDPM) { DBAccess db = new DBAccess(); db.AddParameter("@pidEmpresa", TJDPM.IdEmpresa); db.AddParameter("@pidPeriodo", TJDPM.IdPeriodo); db.AddParameter("@pid_producto", TJDPM.Id_producto); db.AddParameter("@pnu_correficha", TJDPM.Nu_correficha); db.AddParameter("@pnu_secuen", TJDPM.Nu_secuen); db.AddParameter("@pnu_item", TJDPM.Nu_item); db.AddParameter("@pnu_longmalla", TJDPM.Nu_longmalla); db.AddParameter("@pid_ucrearec", TJDPM.Id_ucrearec); db.AddParameter("@pst_anulado", TJDPM.St_anulado); db.ExecuteNonQuery("TJ_Tejeduria_DetMall_mnt01"); }
public static List<ETejeduria_DetMall> TJ_TejeduriaDetMall_qry07(ETejeduria_DetMall oTJ) { DBAccess db = new DBAccess(); //db.AddParameter("@idPeriodo", oTJ.IdPeriodo); db.AddParameter("@idEmpresa", oTJ.IdEmpresa); db.AddParameter("@id_producto", oTJ.Id_producto); db.AddParameter("@nu_correficha", oTJ.Nu_correficha); //db.AddParameter("@nu_secuen", oTJ.Nu_secuen); List<ETejeduria_DetMall> result = new List<ETejeduria_DetMall>(); using (IDataReader rd = db.ExecuteReader("TJ_TejeduriaDetMall_qry07")) { while (rd.Read()) { result.Add(mCargarTJD(rd)); } } return result; }
public void AddMall(ETejeduria_DetMall objTJM, object form) { int count=0; for (int i = 0; dgTJLM.Rows.Count > i; i++) { var nu_secu = dgTJLM.Rows[(i)].Cells["nu_secuen"].Value; var nu_Item = dgTJLM.Rows[(i)].Cells["nu_item"].Value; if (nu_secu.ToString() == objTJM.Nu_secuen.ToString() & nu_Item.ToString() == objTJM.Nu_item.ToString()) { count = count + 1; } } if (count == 0) { dgTJLM.Rows.Add(objTJM.Nu_secuen.ToString(), objTJM.Nu_item.ToString(), objTJM.Nu_longmalla.ToString(), objTJM.St_anulado.ToString()); } }
public static void TJ_Tejeduria_DetMall_mnt01(ETejeduria_DetMall TJD) { DTejeduriaDetMall.TJ_Tejeduria_DetMall_mnt01(TJD); }
public static List<ETejeduria_DetMall> mListarTejeduriaDetMall(ETejeduria_DetMall oTJD) { return DTejeduriaDetMall.TJ_TejeduriaDetMall_qry07(oTJD); }
public void LlenarGrillaLM2(ETejeduria_DetMall OBJTJLM, object form) { string str = Convert.ToString(dgDetalleMall.Rows.Count + 1); string[] row = { OBJTJLM.Nu_secuen, OBJTJLM.Nu_item, OBJTJLM.Nu_longmalla.ToString(), OBJTJLM.St_anulado, }; dgDetalleMall.Rows.Add(row); }
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_DetMall> lstSalvarDatos = new List<ETejeduria_DetMall>(); for (int i = 0; dgDetalleMall.Rows.Count > i; i++) { // la entidad almacena los items de la grilla ETejeduria_DetMall oTJ = new ETejeduria_DetMall(); // verificar si los valores ingresados en la grilla estan en label o texbox como tambien en un dropdowlinst oTJ.Nu_secuen = dgDetalleMall.Rows[i].Cells["nu_secuen"].Value.ToString(); oTJ.Nu_item = dgDetalleMall.Rows[i].Cells["nu_item"].Value.ToString(); oTJ.Nu_longmalla = Convert.ToDecimal(dgDetalleMall.Rows[i].Cells["nu_longmalla"].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(); } }
private void btnEliminarRow_Click(object sender, EventArgs e) { if (dgDetalleMall.RowCount > 0) { ETejeduria_DetMall oTJDM = new ETejeduria_DetMall(); oTJDM.Nu_secuen = dgDetalleMall.CurrentRow.Cells["nu_secuen"].Value.ToString(); oTJDM.Nu_item = dgDetalleMall.CurrentRow.Cells["nu_item"].Value.ToString(); var nuLongMalla = dgDetalleMall.CurrentRow.Cells["nu_longmalla"].Value; if (nuLongMalla.ToString() != "") { oTJDM.Nu_longmalla = Convert.ToDecimal(nuLongMalla); } else { oTJDM.Nu_longmalla = 0; } oTJDM.St_anulado = "1"; FrmTejeduria_mnt frmFormularioAnterior = (FrmTejeduria_mnt)FormParent; frmFormularioAnterior.ElimiItemMall(oTJDM, this); try { dgDetalleMall.Rows.Remove(dgDetalleMall.CurrentRow); } catch (Exception ex) { ex.ToString(); } } else { } }
private void btnAceptar_pop_Click(object sender, EventArgs e) { ETejeduriaDet oTJD = new ETejeduriaDet(); oTJD.Nu_secuen = txtAlimenta.Text; oTJD.Id_numalim = txtAlimenta.Text; oTJD.Ds_distrib = txtDistribucion.Text; oTJD.Ds_estruct = txtEstructura.Text; oTJD.Id_prodhilo = txtHilo.Text; oTJD.ds_prodhilo = lblds_producto.Text; oTJD.Ds_tipfibra = txttipfibra.Text; oTJD.Ds_carachilo = txtcaracHilo.Text; oTJD.Ds_titulo = txttitulo.Text; oTJD.Id_vlustre = txtlustre.Text; oTJD.ds_lustre = cblustre.Text; oTJD.Nu_torsion = txttorsion.Text; oTJD.Id_clipro = txtidprov.Text; oTJD.ds_razsoc = lblprov.Text; oTJD.Nu_lote = txtlote.Text; oTJD.Mt_preuni = Convert.ToDecimal(txtpreuni.Text); oTJD.Ds_etiqueta = txtetiqueta.Text; oTJD.Nu_porhilo = Convert.ToDecimal(txtporcHiloCrudo.Text); oTJD.Nu_porhiloaca = Convert.ToDecimal(txtporcHiloAcabado.Text); oTJD.Nu_tension = Convert.ToDecimal(txttension.Text); oTJD.Nu_bobinas = Convert.ToInt16(txtNumBobinas.Text); oTJD.Nu_alimenta = Convert.ToInt16(txtnumAliment.Text); oTJD.Mt_subtotcon = Convert.ToDecimal("0.0000"); ETejeduria_DetMall _dato = new ETejeduria_DetMall(); if (EstadoDet == 1) { if (txtidprov.Text != "") { FrmTejeduria_mnt frmFormularioAnterior = (FrmTejeduria_mnt)FormParent; if (oTJD.Nu_secuen.ToString() != "") { frmFormularioAnterior.LlenarGrilla(oTJD, this); } else { MessageBox.Show("El usuario debe de ingresar el # Alimenta", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information); } for (int i = 0; dgDetalleMall.Rows.Count > i; i++) { var nu_item = dgDetalleMall.Rows[i].Cells["nu_item"].Value; var nu_longmalla = dgDetalleMall.Rows[i].Cells["nu_longmalla"].Value; if (_nu_secu != null) { _dato.Nu_secuen = _nu_secu; } else { _dato.Nu_secuen = txtAlimenta.Text; } _dato.Nu_item = nu_item.ToString(); if (nu_longmalla.ToString() !="") { _dato.Nu_longmalla = Convert.ToDecimal(nu_longmalla); } else { _dato.Nu_longmalla = 0; MessageBox.Show("El usuario debe de ingresar la longitud de la malla", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } _dato.St_anulado = "0"; frmFormularioAnterior.LlenarGrillaLI(_dato, this); this.Close(); } } else { MessageBox.Show("Falta Ingresar el proveedor", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else if(EstadoDet ==2) { FrmTejeduria_mnt frmFormularioAnterior = (FrmTejeduria_mnt)FormParent; frmFormularioAnterior.ModGuilla(oTJD, this); for (int i = 0; dgDetalleMall.Rows.Count > i; i++) { var nu_item = dgDetalleMall.Rows[i].Cells["nu_item"].Value; var nu_longmalla = dgDetalleMall.Rows[i].Cells["nu_longmalla"].Value; _dato.Nu_secuen = _nu_secu; _dato.Nu_item = nu_item.ToString(); _dato.Nu_longmalla = Convert.ToDecimal(nu_longmalla); _dato.St_anulado = "0"; frmFormularioAnterior.LlenarGrillaLM(_dato, this); } this.Close(); } }
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 dgDetalle_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { DataGridViewRow dRow = dgDetalle.Rows[e.RowIndex]; _drow = dRow.Index.ToString(); ETejeduriaDet objTJ = new ETejeduriaDet(); objTJ.Id_producto = txt_idTejido.Text; objTJ.Nu_correficha = txt_nuFicha.Text; objTJ.Nu_secuen = (dRow.Cells["_nu_secuen"].Value == null) ? "" : dRow.Cells["_nu_secuen"].Value.ToString(); objTJ.Id_numalim = (dRow.Cells["Alim"].Value == null) ? "" : dRow.Cells["Alim"].Value.ToString(); objTJ.Ds_distrib = (dRow.Cells["Distribucion"].Value == null) ? "" : dRow.Cells["Distribucion"].Value.ToString(); objTJ.Ds_estruct = (dRow.Cells["estructura"].Value == null) ? "" : dRow.Cells["estructura"].Value.ToString(); objTJ.Id_prodhilo = (dRow.Cells["idHilo"].Value == null) ? "" : dRow.Cells["idHilo"].Value.ToString(); objTJ.ds_prodhilo = (dRow.Cells["Hilo"].Value == null) ? "" : dRow.Cells["Hilo"].Value.ToString(); objTJ.Ds_tipfibra = (dRow.Cells["tipo_fibra"].Value == null) ? "" : dRow.Cells["tipo_fibra"].Value.ToString(); objTJ.Ds_carachilo = (dRow.Cells["carac_hilo"].Value == null) ? "" : dRow.Cells["carac_hilo"].Value.ToString(); objTJ.Ds_titulo = (dRow.Cells["titulo"].Value == null) ? "" : dRow.Cells["titulo"].Value.ToString(); objTJ.Id_vlustre = (dRow.Cells["idLustre"].Value == null) ? "" : dRow.Cells["idLustre"].Value.ToString(); objTJ.ds_lustre = (dRow.Cells["lustre"].Value == null) ? "" : dRow.Cells["lustre"].Value.ToString(); objTJ.Nu_torsion = (dRow.Cells["Nu_torsion"].Value == null) ? "" : dRow.Cells["Nu_torsion"].Value.ToString(); objTJ.Id_clipro = (dRow.Cells["idProv"].Value == null) ? "" : dRow.Cells["idProv"].Value.ToString(); objTJ.ds_razsoc = (dRow.Cells["proveedor"].Value == null) ? "" : dRow.Cells["proveedor"].Value.ToString(); objTJ.Nu_lote = (dRow.Cells["Lote"].Value == null) ? "" : dRow.Cells["Lote"].Value.ToString(); objTJ.Ds_etiqueta = (dRow.Cells["etiqueta"].Value == null) ? "" : dRow.Cells["etiqueta"].Value.ToString(); objTJ.Nu_porhilo = (dRow.Cells["porHiloCrudo"].Value == null) ? 0 : Convert.ToDecimal(dRow.Cells["porHiloCrudo"].Value.ToString()); objTJ.Nu_porhiloaca = (dRow.Cells["porHiloAcab"].Value == null) ? 0 : Convert.ToDecimal(dRow.Cells["porHiloAcab"].Value.ToString()); objTJ.Nu_tension = (dRow.Cells["nu_tension"].Value == null) ? 0 : Convert.ToDecimal(dRow.Cells["nu_tension"].Value.ToString()); objTJ.Nu_bobinas = (dRow.Cells["nu_bobinas"].Value == null) ? 0 : Convert.ToInt16(dRow.Cells["nu_bobinas"].Value.ToString()); objTJ.Nu_alimenta = (dRow.Cells["nu_aliment"].Value == null) ? 0 : Convert.ToInt16(dRow.Cells["nu_aliment"].Value.ToString()); objTJ.Mt_preuni = (dRow.Cells["pre_uni"].Value == null) ? 0 : Convert.ToDecimal(dRow.Cells["pre_uni"].Value.ToString()); objTJ.Mt_subtotcon = (dRow.Cells["Sub_total"].Value == null) ? 0 : Convert.ToDecimal(dRow.Cells["Sub_total"].Value.ToString()); /// frmModalDetalle frmpop = new frmModalDetalle(); frmpop.FormParent = this; frmpop.EstadoDet = 2; frmpop.LLenarCampos(objTJ); /// DETALLE DE LONGITUD MALLA ETejeduria_DetMall objLM = new ETejeduria_DetMall(); //DataGridViewRow dRow2 = dgTJLM.Rows[e.RowIndex]; for (int i = 0; dgTJLM.Rows.Count > i; i++) { var nu_secuen = dgTJLM.Rows[i].Cells["nu_secuen"].Value; var nu_item = dgTJLM.Rows[i].Cells["nu_item"].Value; var nu_longmalla = dgTJLM.Rows[i].Cells["nu_longmalla"].Value; var st_anulado = dgTJLM.Rows[i].Cells["_st_anulado"].Value; if (nu_secuen.ToString() == objTJ.Nu_secuen.ToString() & st_anulado.ToString()=="0") { objLM.Nu_secuen = nu_secuen.ToString(); objLM.Nu_item = nu_item.ToString(); objLM.Nu_longmalla = Convert.ToDecimal(nu_longmalla); objLM.St_anulado = st_anulado.ToString(); frmpop.LlenarGrillaLM2(objLM, this); } } frmpop.ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
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(); } }
public void LlenarGrillaLM(ETejeduria_DetMall OBJTJLM, object form) { string str = Convert.ToString(dgTJLM.Rows.Count + 1); var nusecu = OBJTJLM.Nu_secuen; var nuItem = OBJTJLM.Nu_item; var nulong = OBJTJLM.Nu_longmalla.ToString(); var stanu = OBJTJLM.St_anulado; for (int i = 0; dgTJLM.Rows.Count > i; i++) { var nu_secu = dgTJLM.Rows[(i)].Cells["nu_secuen"].Value; var nu_Item = dgTJLM.Rows[(i)].Cells["nu_item"].Value; //var stAnulado = dgTJLM.Rows[(i)].Cells["_st_anulado"].Value; //var stAnulado = dgTJLM.Rows[(i)].Cells["_st_anulado"].Value; if (nu_secu.ToString() == nusecu.ToString() & nu_Item.ToString() == nuItem.ToString()) {// & stAnulado.ToString() == stanu.ToString() (dgTJLM.Rows[(i)].Cells["nu_secuen"]).Value = nusecu.ToString(); (dgTJLM.Rows[(i)].Cells["nu_item"]).Value = nu_Item.ToString(); (dgTJLM.Rows[(i)].Cells["nu_longmalla"]).Value = nulong.ToString(); (dgTJLM.Rows[(i)].Cells["_st_anulado"]).Value = stanu.ToString(); } } int count2 = 0; for (int u = 0; dgTJLM.Rows.Count > u;u++) { var _nu_secu = dgTJLM.Rows[(u)].Cells["nu_secuen"].Value; var _nu_Item = dgTJLM.Rows[(u)].Cells["nu_item"].Value; if (_nu_secu.ToString() == OBJTJLM.Nu_secuen && _nu_Item.ToString() == OBJTJLM.Nu_item) { count2 = count2 + 1; } else { } } if (count2 == 0) { //string str = Convert.ToString(dgTJLM.Rows.Count + 1); string[] row = { OBJTJLM.Nu_secuen, OBJTJLM.Nu_item, OBJTJLM.Nu_longmalla.ToString(), OBJTJLM.St_anulado, }; dgTJLM.Rows.Add(row); } else { //MessageBox.Show("Ya existe este Articulo", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Information); //frm.Close(); } }
public void ElimiItemMall(ETejeduria_DetMall objTJM, object form) { string str = Convert.ToString(dgTJLM.Rows.Count + 1); for (int i = 0; dgTJLM.Rows.Count > i; i++) { var nu_secu = dgTJLM.Rows[(i)].Cells["nu_secuen"].Value; var nu_Item = dgTJLM.Rows[(i)].Cells["nu_item"].Value; if (nu_secu.ToString() == objTJM.Nu_secuen.ToString() & nu_Item.ToString() == objTJM.Nu_item.ToString()) { (dgTJLM.Rows[(i)].Cells["nu_secuen"]).Value = objTJM.Nu_secuen.ToString(); (dgTJLM.Rows[(i)].Cells["nu_item"]).Value = objTJM.Nu_item.ToString(); (dgTJLM.Rows[(i)].Cells["nu_longmalla"]).Value = objTJM.Nu_longmalla.ToString(); (dgTJLM.Rows[(i)].Cells["_st_anulado"]).Value = objTJM.St_anulado.ToString(); } } }