//JC 100921 Actualiza Bodega cuando se retorna todo el pallet public int ActualizaRegistrobodegaxtabla(ref Ent_tticol100 parametro, ref string location, ref string tableName, ref string strError) { method = MethodBase.GetCurrentMethod(); bool retorno = false; try { paramList = new Dictionary <string, object>(); paramList.Add(":T$CWAT", parametro.cwar.Trim().ToUpper()); paramList.Add(":T$PAID", parametro.paid.Trim().ToUpper()); paramList.Add(":T$ACLO", location); paramList.Add(":TABLENAME", "T" + tableName.Trim().ToUpper()); if (tableName == "whcol131") { strSentencia = recursos.readStatement(method.ReflectedType.Name, "ActualizaRegistrobodegaxtabla_whcol131", ref owner, ref env, tabla, paramList); } else { strSentencia = recursos.readStatement(method.ReflectedType.Name, "ActualizaRegistrobodegaxtabla", ref owner, ref env, tabla, paramList); } retorno = DAL.BaseDAL.BaseDal.EjecutarCrud("text", strSentencia, ref parametersOut, parametrosIn, false); return(Convert.ToInt32(retorno)); } catch (Exception ex) { strError = ex.InnerException != null ? ex.Message + " (" + ex.InnerException + ")" : ex.Message; } return(Convert.ToInt32(retorno)); }
public static string verifyWarehouse(string CWAR) { Ent_twhcol130131 MyObj = new Ent_twhcol130131(); Ent_tticol100 myObj100 = new Ent_tticol100(); myObj100.cwar = CWAR.Trim().ToUpper(); DataTable DTWare = dalticol100.selecthandletwhwmd200(ref myObj100, ref strError); if (DTWare.Rows.Count > 0) { var MyObjDT = DTWare.Rows[0]; MyObj.CWAR = MyObjDT["warehosue"].ToString(); MyObj.SLOC = MyObjDT["handle_locations"].ToString(); MyObj.Error = false; MyObj.errorMsg = string.Empty; MyObj.TipeMsgJs = string.Empty; } else { MyObj.Error = true; MyObj.errorMsg = Warehousecodedoesntexist; MyObj.TipeMsgJs = "Label"; } return(JsonConvert.SerializeObject(MyObj)); }
//JC 060921 Ajustar datos para grabar y actualizar regrind public int ActualizaRegistro_ticol042(ref Ent_tticol100 parametro, ref string strError) { method = MethodBase.GetCurrentMethod(); bool retorno = false; try { paramList = new Dictionary <string, object>(); paramList.Add(":T$DELE", parametro.dele.Trim().ToUpper()); paramList.Add(":T$PAID", parametro.paid.Trim().ToUpper()); paramList.Add(":T$LOGN", parametro.logr.Trim().ToUpper()); strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla, paramList); retorno = DAL.BaseDAL.BaseDal.EjecutarCrud("text", strSentencia, ref parametersOut, parametrosIn, false); return(Convert.ToInt32(retorno)); } catch (Exception ex) { strError = ex.InnerException != null ? ex.Message + " (" + ex.InnerException + ")" : ex.Message; } return(Convert.ToInt32(retorno)); }
//JC 060921 Ajustar datos para grabar regrind public int ActualUpdateWarehouse_ticol242(ref Ent_tticol100 parametro, ref string strError, ref string tipo) { method = MethodBase.GetCurrentMethod(); bool retorno = false; var qt = parametro.qtyr; var plt = parametro.paid; plt.Substring(11, 1); try { paramList = new Dictionary <string, object>(); if (tipo == "Located") { paramList.Add(":T$CWAT", " "); } paramList.Add(":T$SQNB", parametro.paid.Trim().ToUpper()); paramList.Add(":T$ACLO", " "); paramList.Add(":T$ACQT", parametro.qtyr); strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla, paramList); retorno = DAL.BaseDAL.BaseDal.EjecutarCrud("text", strSentencia, ref parametersOut, parametrosIn, false); return(Convert.ToInt32(retorno)); } catch (Exception ex) { strError = ex.InnerException != null ? ex.Message + " (" + ex.InnerException + ")" : ex.Message; } return(Convert.ToInt32(retorno)); }
protected void MakeLabel(Ent_tticol100 Objtticol100) { var sqnb = Objtticol100.pdno + "-" + Objtticol100.pono + "-" + Objtticol100.proc; var mitm = Objtticol100.item; var dsca = txtDescription.Text; var qtyr = Objtticol100.qtyr + "-" + Objtticol100.Unit; var pdno = Objtticol100.pdno; var clot = Objtticol100.clot; //T$SQNB lblDmtNumber.Text = "DMT-NUMBER"; Label1.Text = "Description"; lblRejected.Text = "Rejected Qty"; Label11.Text = "WorkOrder"; lblDescLot.Text = "Lot"; //Label2.Text = "Disposition - Review"; lblPrintedBy.Text = "Printed By"; lblReason.Text = "Reason"; lblFecha.Text = "Date"; lblComments.Text = "Comments"; Label3.Text = "Reason"; lblValuePrintedBy.Text = Objtticol100.logr; lblDsca.Text = qtyr; LblSqnb.Text = sqnb; lblValueReason.Text = slReason.SelectedItem.Text.Substring(7); var rutaLot = UrlBaseBarcode + "/Barcode/BarcodeHandler.ashx?data=" + clot.ToUpper() + "&code=Code128&dpi=96"; imgBCClot.Src = string.IsNullOrWhiteSpace(clot) ? string.Empty : rutaLot; var rutaSqnb = UrlBaseBarcode + "/Barcode/BarcodeHandler.ashx?data=" + sqnb + "&code=Code128&dpi=96"; imgCBSqnb.Src = !string.IsNullOrEmpty(sqnb) ? rutaSqnb : String.Empty; //T$MITM var rutaMitm = UrlBaseBarcode + "/Barcode/BarcodeHandler.ashx?data=" + mitm.ToUpper() + "&code=Code128&dpi=96"; imgCBMitm.Src = !string.IsNullOrEmpty(mitm) ? rutaMitm : String.Empty; //T$DSCA lblDsca.Text = dsca; //T$QTDL lblQtdl.Text = Convert.ToString(qtyr); var rutaQtdl = UrlBaseBarcode + "/Barcode/BarcodeHandler.ashx?data=" + Convert.ToString(Objtticol100.qtyr).ToUpper() + "&code=Code128&dpi=96"; imgBCQtdl.Src = !string.IsNullOrEmpty(Convert.ToString(Objtticol100.qtyr)) ? rutaQtdl : String.Empty; //T$PDNO lblPdno.Text = pdno; var rutaPdno = UrlBaseBarcode + "/Barcode/BarcodeHandler.ashx?data=" + pdno.ToUpper() + "&code=Code128&dpi=96"; imgBCPdno.Src = !string.IsNullOrEmpty(pdno) ? rutaPdno : String.Empty; lblMachinetitle.Text = "Machine"; lblMachine.Text = Objtticol100.mcno; lblValueComments.Text = txtExactReasons.InnerText; }
public int ActualUpdateWarehouse_ticol222(ref Ent_tticol100 data, ref string strError, ref string tipo) { int retorno = -1; try { retorno = dal.ActualUpdateWarehouse_ticol222(ref data, ref strError, ref tipo); return(retorno); } catch (Exception ex) { throw new Exception(strError += "\nPila: " + ex.Message); } }
//JC 100921 Actualizar bodega en la tabla col222 public int ActualizaRegistrobodegaxtabla(ref Ent_tticol100 parametrosIn, ref string location, ref string tableName, ref string strError) { int retorno = -1; try { retorno = dal.ActualizaRegistrobodegaxtabla(ref parametrosIn, ref location, ref tableName, ref strError); return(retorno); } catch (Exception ex) { throw new Exception(strError += "\nPila: " + ex.Message); } }
public DataTable selecthandletwhwmd200(ref Ent_tticol100 parametro, ref string strError) { DataTable retorno = new DataTable(); try { retorno = dal.selecthandletwhwmd200(ref parametro, ref strError); return(retorno); } catch (Exception ex) { throw new Exception(strError += "\nPila: " + ex.Message); } }
public int insertRecord(ref Ent_tticol100 parametrosIn, ref string strError) { int retorno = -1; try { retorno = dal.insertRecord(ref parametrosIn, ref strError); return(retorno); } catch (Exception ex) { throw new Exception(strError += "\nPila: " + ex.Message); } }
public int insertRecord(ref Ent_tticol100 parametro, ref string strError) { method = MethodBase.GetCurrentMethod(); bool retorno = false; try { paramList = new Dictionary <string, object>(); paramList.Add(":T$PDNO", parametro.pdno); paramList.Add(":T$PONO", parametro.pono); paramList.Add(":T$SEQN", parametro.seqn); paramList.Add(":T$MCNO", parametro.mcno); paramList.Add(":T$SHIF", parametro.shif.ToUpper()); paramList.Add(":T$ITEM", parametro.item); paramList.Add(":T$QTYR", parametro.qtyr); paramList.Add(":T$CDIS", parametro.cdis); paramList.Add(":T$REJT", parametro.rejt); paramList.Add(":T$CLOT", parametro.clot); paramList.Add(":T$OBSE", parametro.obse); paramList.Add(":T$LOGR", parametro.logr); paramList.Add(":T$DISP", parametro.disp); paramList.Add(":T$LOGN", parametro.logn); paramList.Add(":T$PROC", parametro.proc); paramList.Add(":T$MESS", parametro.mess); paramList.Add(":T$REFCNTD", parametro.refcntd); paramList.Add(":T$REFCNTU", parametro.refcntu); paramList.Add(":T$CWAR", parametro.cwar); paramList.Add(":T$PAID", parametro.paid); paramList.Add(":T$PAIO", parametro.paio); strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla, paramList); //parametrosIn = AdicionaParametrosComunes(parametro); retorno = DAL.BaseDAL.BaseDal.EjecutarCrud("text", strSentencia, ref parametersOut, parametrosIn, false); return(Convert.ToInt32(retorno)); } catch (Exception ex) { strError = ex.InnerException != null ? ex.Message + " (" + ex.InnerException + ")" : ex.Message; } return(Convert.ToInt32(retorno)); }
private List <Ent_ParametrosDAL> AdicionaParametrosComunes(Ent_tticol100 parametros, bool blnUsarPRetorno = false) { method = MethodBase.GetCurrentMethod(); string strError = string.Empty; List <Ent_ParametrosDAL> parameterCollection = new List <Ent_ParametrosDAL>(); try { Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$PDNO", DbType.String, parametros.pdno.ToUpper()); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$PONO", DbType.Int32, parametros.pono); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$SEQN", DbType.Int32, parametros.seqn); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$MCNO", DbType.String, parametros.mcno.ToUpper()); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$SHIF", DbType.String, parametros.shif.ToUpper()); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$ITEM", DbType.String, parametros.item.ToUpper()); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$QTYR", DbType.Double, parametros.qtyr); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$CDIS", DbType.String, parametros.cdis.ToUpper()); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$REJT", DbType.Int32, parametros.rejt); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$CLOT", DbType.String, parametros.clot.ToUpper()); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$OBSE", DbType.String, parametros.obse.ToUpper()); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$LOGR", DbType.String, parametros.logr.ToUpper()); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$DISP", DbType.Int32, parametros.disp); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$LOGN", DbType.String, parametros.logn.ToUpper()); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$PROC", DbType.Int32, parametros.proc); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$MESS", DbType.String, parametros.mess.ToUpper()); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$REFCNTD", DbType.Int32, parametros.refcntd); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$REFCNTU", DbType.Int32, parametros.refcntu); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$PAID", DbType.String, parametros.paid.ToUpper()); Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$CWAR", DbType.String, parametros.cwar.ToUpper()); if (blnUsarPRetorno) { Ent_ParametrosDAL pDal = new Ent_ParametrosDAL(); pDal.Name = "@p_Int_Resultado"; pDal.Type = DbType.Int32; pDal.ParDirection = ParameterDirection.Output; parameterCollection.Add(pDal); } } catch (Exception ex) { strError = "Error when creating parameters [301]. Try again or contact your administrator \n"; log.escribirError(strError + Console.Out.NewLine + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name); } return(parameterCollection); }
public DataTable selecthandletwhwmd200(ref Ent_tticol100 parametro, ref string strError) { method = MethodBase.GetCurrentMethod(); DataTable consulta = new DataTable(); try { paramList = new Dictionary <string, object>(); paramList.Add(":T$SWAR", parametro.cwar.Trim().ToUpper()); //strSentencia = "select t$cwar warehosue, t$sloc handle_locations from " + owner + ".twhwmd200" + env + " where t$cwar = '" + stockw.Trim().ToUpper() + "'"; strSentencia = recursos.readStatement(method.ReflectedType.Name, "selecthandletwhwmd200", ref owner, ref env, tabla, paramList); consulta = DAL.BaseDAL.BaseDal.EjecutarCons("Text", strSentencia, ref parametersOut, null, true); } catch (Exception ex) { strError = ex.InnerException != null ? ex.Message + " (" + ex.InnerException + ")" : ex.Message; } return(consulta); }
protected void MakeLabel(Ent_tticol100 Objtticol100) { var rstp = "10"; listaReasons = _idalttcmcs005.findRecords(ref rstp, ref strError); IList <Reason> lstReasons = new List <Reason>(); foreach (DataRow item in listaReasons.Rows) { Reason reason = new Reason { cdis = item["CDIS"].ToString(), dsca = item["DSCA"].ToString() }; lstReasons.Add(reason); } var ObjReason = lstReasons.Where(x => x.cdis.Trim().ToUpper() == Objtticol100.cdis.Trim().ToUpper()).Single(); var sqnb = _validarOrden.Rows[0]["SQNB"].ToString().Trim().ToUpper(); var mitm = _validarOrden.Rows[0]["MITM"].ToString().Trim().ToUpper(); var dsca = _validarOrden.Rows[0]["DSCA"].ToString().Trim().ToUpper(); var qtyr = _validarOrden.Rows[0]["QTDL"].ToString().Trim().ToUpper(); var pdno = _validarOrden.Rows[0]["PDNO"].ToString().Trim().ToUpper(); //T$SQNB lblDmtNumber.Text = "DMT-NUMBER"; lblDescription.Text = "Description"; lblRejected.Text = "Rejected Qty"; Label1.Text = "WorkOrder"; lblTitleMachine.Text = "Machine"; Label2.Text = "Disposition - Review"; lblPrintedBy.Text = "Printed By"; lblReason.Text = "Reason"; lblFecha.Text = "Date:"; lblValueReason.Text = "Adhesion"; lblComments.Text = "Comments"; lblDescMachine.Text = Objtticol100.mcno; lblValueComments.Text = Objtticol100.obse; lblValuePrintedBy.Text = Objtticol100.logr; lblValueReason.Text = ObjReason.dsca; LblSqnb.Text = sqnb; var rutaSqnb = UrlBaseBarcode + "/Barcode/BarcodeHandler.ashx?data=" + sqnb.ToUpper() + "&code=Code128&dpi=96"; imgCBSqnb.Src = !string.IsNullOrEmpty(sqnb) ? rutaSqnb : String.Empty; //T$MITM lblDsca.Text = mitm; var rutaMitm = UrlBaseBarcode + "/Barcode/BarcodeHandler.ashx?data=" + mitm.ToUpper() + "&code=Code128&dpi=96"; imgCBMitm.Src = !string.IsNullOrEmpty(mitm) ? rutaMitm : String.Empty; //T$DSCA lblDsca.Text = dsca; //T$QTDL lblValueQuantity.Text = Convert.ToString(qtyr); lblQtdl.Text = Objtticol100.Unit; var rutaQtdl = UrlBaseBarcode + "/Barcode/BarcodeHandler.ashx?data=" + Convert.ToString(qtyr).ToUpper() + "&code=Code128&dpi=96"; imgBCQtdl.Src = !string.IsNullOrEmpty(Convert.ToString(qtyr)) ? rutaQtdl : String.Empty; //T$PDNO lblPdno.Text = pdno; var rutaPdno = UrlBaseBarcode + "/Barcode/BarcodeHandler.ashx?data=" + pdno.ToUpper() + "&code=Code128&dpi=96"; imgBCPdno.Src = !string.IsNullOrEmpty(pdno) ? rutaPdno : String.Empty; }
protected void btnGuardar_Click(object sender, EventArgs e) { var validInsert = 0; var validUpdate = 0; Ent_tticol100 Objdata100 = new Ent_tticol100(); for (int i = 0; i < _validarOrden.Rows.Count; i++) { var shift = Request.Form["txtShift-" + i].ToString().Trim(); var reason = Request.Form["slReasons-" + i].ToString().Trim(); var rejectType = Request.Form["txtRejectType-" + i].ToString().Trim(); var exactReasons = Request.Form["txtExactReason-" + i].ToString().Trim(); var pdno = txtWorkOrder.Text.Trim().ToUpper().Substring(0, 9); var machine = " "; var consecutivo = 1; if (shift != String.Empty && exactReasons != String.Empty) { var findMachine = _idaltticol011.findRecordByPdno(ref pdno, ref strError); if (findMachine.Rows.Count > 0) { machine = findMachine.Rows[0]["MCNO"].ToString(); } var consultaConsecutivo = _idaltticol100.findMaxSeqnByPdno(ref pdno, ref strError); if (consultaConsecutivo.Rows.Count > 0) { consecutivo = Convert.ToInt32(consultaConsecutivo.Rows[0]["SEQN"]) + 1; } Ent_tticol100 data100 = new Ent_tticol100() { pdno = pdno, seqn = consecutivo, seqnR = _validarOrden.Rows[0][1].ToString().Trim().ToUpper(), mcno = machine, shif = shift, item = _validarOrden.Rows[i]["MITM"].ToString().Trim().ToUpper(), qtyr = double.Parse(_validarOrden.Rows[i]["QTDL"].ToString().Trim(), CultureInfo.InvariantCulture.NumberFormat), cdis = reason, rejt = Convert.ToInt32(rejectType), clot = pdno, obse = exactReasons, logr = HttpContext.Current.Session["user"].ToString(), dsca = _validarOrden.Rows[i]["DSCA"].ToString().Trim().ToUpper(), cwar = _validarOrden.Rows[i]["CWAR"].ToString().Trim().ToUpper(), paid = txtWorkOrder.Text.Trim().ToUpper(), paio = txtWorkOrder.Text.Trim().ToUpper() }; Objdata100 = data100; validInsert += _idaltticol100.insertRecord(ref data100, ref strError); if (validInsert > 0) { validUpdate = _idaltticol100.ActualizaRegistro_ticol022(ref data100, ref strError); } } } if (validInsert > 0) { lblError.Text = ""; lblConfirm.Text = mensajes("msjsave"); divTable.InnerHtml = String.Empty; divBtnGuardar.Visible = false; txtWorkOrder.Text = String.Empty; MakeLabel(Objdata100); divLabel.Visible = true; divBotones.Visible = true; } else { lblError.Text = mensajes("errorsave"); return; } }
protected void btnGuardar_Click(object sender, EventArgs e) { var pdno = txtWorkOrder.Text.Trim().ToUpper(); var machine = " "; var seqn = 1; var item = slItems.SelectedValue.Trim().ToUpper(); var clot = slLot.SelectedValue.Trim().ToUpper(); var reason = slReason.SelectedValue.Trim().ToUpper(); var rejectType = slRejectType.SelectedValue.Trim().ToUpper(); var qtyr = double.Parse(txtQty.Text.Trim(), CultureInfo.InvariantCulture.NumberFormat); if (item == string.Empty) { lblError.Text = TheItemcantbeempty; return; } if (reason == string.Empty) { lblError.Text = TheReasoncantbeempty; return; } if (rejectType == string.Empty) { lblError.Text = TheRejectTypecantbeempty; return; } if (qtyr.ToString() == string.Empty) { lblError.Text = TheCantcantbeempty; return; } var consultaMaquina = _idaltticol011.findRecordByPdno(ref pdno, ref strError); if (consultaMaquina.Rows.Count > 0) { machine = consultaMaquina.Rows[0]["MCNO"].ToString().Trim(); } var registroItem = _consultaInformacionPedido.AsEnumerable().Where(x => x["SITM"].ToString().Trim() == item).FirstOrDefault(); var kltc = registroItem["KLTC"].ToString(); var pono = registroItem["PONO"].ToString(); if (kltc == "1") { if (clot == string.Empty) { lblError.Text = Thelotcantbeempty; return; } Ent_twhltc100 data100 = new Ent_twhltc100() { item = item, clot = clot }; var validaLote = _idaltwhltc100.listaRegistro_Clot(ref data100, ref strError); if (validaLote.Rows.Count < 0) { lblError.Text = mensajes("lotnotexists"); return; } } var consultaSecuencia = _idaltticol100.findMaxSeqnByPdnoPono(ref pdno, ref pono, ref strError); if (consultaSecuencia.Rows.Count > 0) { seqn = Convert.ToInt32(consultaSecuencia.Rows[0]["SEQN"]) + 1; } Ent_tticol100 dataticol100 = new Ent_tticol100() { //dsca = .Text, pdno = pdno, pono = Convert.ToInt32(pono), seqn = seqn, mcno = machine, item = item, qtyr = qtyr, shif = txtShift.Text.Trim().ToUpper(), cdis = slReason.SelectedValue.Trim().ToUpper(), rejt = Convert.ToInt32(slRejectType.SelectedValue), clot = slLot.SelectedValue == "" ? " " : slLot.SelectedValue.Trim().ToUpper(), obse = txtExactReasons.InnerText, logr = HttpContext.Current.Session["user"].ToString(), disp = 4, proc = 1, Unit = txtUnit.Text, logn = HttpContext.Current.Session["user"].ToString(), mess = "0" }; var validaInsert = _idaltticol100.insertRecord(ref dataticol100, ref strError); if (validaInsert > 0) { lblError.Text = String.Empty; lblConfirm.Text = mensajes("msjsave"); divTable.Visible = false; divBtnGuardar.Visible = false; txtWorkOrder.Text = String.Empty; MakeLabel(dataticol100); divLabel.Visible = true; divBotones.Visible = true; } else { lblError.Text = mensajes("errorsave"); return; } }