Ejemplo n.º 1
0
        public DataTable invLabel_listaRegistrosOrdenMaquina_Workorder(ref Ent_tticol011 ParametrosIn, ref string strError)
        {
            method = MethodBase.GetCurrentMethod();

            paramList = new Dictionary <string, object>();
            paramList.Add("p1", ParametrosIn.pdno.Trim().ToUpperInvariant());

            strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla, paramList);

            try
            {
                consulta = DAL.BaseDAL.BaseDal.EjecutarCons("Text", strSentencia, ref parametersOut, null, true);
                if (consulta.Rows.Count < 1)
                {
                    strError = "Order doesn't initiated for machine. " + ParametrosIn.mcno.Trim().ToUpperInvariant();
                }
                if (consulta.Rows.Count > 1)
                {
                    strError = "More than one work order found";
                }
            }
            catch (Exception ex)
            {
                strError = "Error when querying data [tticol011]. Try again or contact your administrator \n " + strSentencia;
                log.escribirError(strError + Console.Out.NewLine + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name);
            }
            return(consulta);
        }
Ejemplo n.º 2
0
        public bool updateStatusFinish(ref Ent_tticol011 data, ref string strError)
        {
            method = MethodBase.GetCurrentMethod();
            bool retorno = false;

            try
            {
                paramList = new Dictionary <string, object>();
                paramList.Add(":T$STAT", data.stat);
                paramList.Add(":T$COMB", data.comb.Trim().ToUpper());
                paramList.Add(":T$PDNO", data.pdno.Trim().ToUpper());
                paramList.Add(":T$MCNO", data.mcno.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(retorno);
            }

            catch (Exception ex)
            {
                strError = ex.InnerException != null ?
                           ex.Message + " (" + ex.InnerException + ")" :
                           ex.Message;
            }

            return(retorno);
        }
Ejemplo n.º 3
0
        public DataTable listaRegistrosMaquina_Param(ref Ent_tticol011 ParametrosIn, ref string strError)
        {
            String env   = ConfigurationManager.AppSettings["env"].ToString();
            String owner = ConfigurationManager.AppSettings["owner"].ToString();
            string tabla = owner + ".ttirou002" + env;

            method = MethodBase.GetCurrentMethod();

            paramList = new Dictionary <string, object>();
            paramList.Add("p1", ParametrosIn.mcno.Trim().ToUpperInvariant());

            strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla, paramList);

            try
            {
                consulta = DAL.BaseDAL.BaseDal.EjecutarCons("Text", strSentencia, ref parametersOut, null, true);
                if (consulta.Rows.Count < 1)
                {
                    strError = "Machine doesn't exist. " + ParametrosIn.mcno.Trim().ToUpperInvariant();
                }
            }
            catch (Exception ex)
            {
                strError = "Error when querying data [ttirou002]. Try again or contact your administrator \n " + strSentencia;
                log.escribirError(strError + Console.Out.NewLine + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name);
            }
            return(consulta);
        }
Ejemplo n.º 4
0
        protected void btnSaveOrder_Click(object sender, EventArgs e)
        {
            if (slAction.SelectedValue != String.Empty)
            {
                var stat = (enumStatus)Convert.ToInt32(slAction.SelectedValue);

                var updateStatus = false;

                Ent_tticol011 data011 = new Ent_tticol011()
                {
                    stat = Convert.ToInt32(slAction.SelectedValue),
                    inib = HttpContext.Current.Session["user"].ToString(),
                    pdno = lblValueOrder.Text.Trim().ToUpper(),
                    mcno = lblValueMachine.Text.Trim().ToUpper(),
                    comb = HttpContext.Current.Session["user"].ToString()
                };

                switch (stat)
                {
                case enumStatus.Initiated:
                    updateStatus = _idaltticol011.updateStatusInitiated(ref data011, ref strError);
                    break;

                case enumStatus.Finished:
                    updateStatus = _idaltticol011.updateStatusFinish(ref data011, ref strError);
                    break;

                case enumStatus.OnHold:
                    updateStatus = _idaltticol011.updateStatusOnHold(ref data011, ref strError);
                    break;
                }

                if (updateStatus)
                {
                    lblError.Text     = String.Empty;
                    lblConfirm.Text   = mensajes("msjupdate");
                    txtWorkOrder.Text = String.Empty;
                    divTable.Visible  = false;
                }
                else
                {
                    lblError.Text = mensajes("errorupdt");
                    return;
                }
            }
            else
            {
                lblError.Text = mensajes("formempty");
                return;
            }
        }
Ejemplo n.º 5
0
        public bool updateStatusFinish(ref Ent_tticol011 data, ref string strError)
        {
            bool retorno = false;

            try
            {
                retorno = dal.updateStatusFinish(ref data, ref strError);
                return(retorno);
            }
            catch (Exception ex)
            {
                throw new Exception(strError += "\nPila: " + ex.Message);
            }
        }
Ejemplo n.º 6
0
        public DataTable invLabel_listaRegistrosOrdenMaquina_Param(ref Ent_tticol011 Parametros, ref string strError)
        {
            //int retorno = -1;
            DataTable retorno;

            try
            {
                retorno = dal.invLabel_listaRegistrosOrdenMaquina_Param(ref Parametros, ref strError);
                return(retorno);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.InnerException.ToString());
            }
        }
Ejemplo n.º 7
0
        public DataTable invLabelRegrind_listaRegistrosOrdenParam(ref Ent_tticol011 ParametrosIn, ref string strError)
        {
            method = MethodBase.GetCurrentMethod();

            paramList = new Dictionary <string, object>();
            paramList.Add("p1", ParametrosIn.pdno.Trim().ToUpperInvariant());

            strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla, paramList);

            try
            {
                consulta = DAL.BaseDAL.BaseDal.EjecutarCons("Text", strSentencia, ref parametersOut, null, true);
                if (consulta.Rows.Count < 1)
                {
                    strError = "Order " + ParametrosIn.pdno.Trim() + " doesn't exist or the status is not active, release or completed.";
                }
                else
                {
                    if (ParametrosIn.Acceso)
                    {
                        strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla, paramList, 1);
                        try
                        {
                            consulta = DAL.BaseDAL.BaseDal.EjecutarCons("Text", strSentencia, ref parametersOut, null, true);
                            if (consulta.Rows.Count < 1)
                            {
                                strError = "Order " + ParametrosIn.pdno.Trim() + " doesn't contains item for list.";
                            }
                        }
                        catch (Exception e)
                        {
                            strError = "Error al consultar para la lista. Try again or contact your administrator \n " + strSentencia;
                            log.escribirError(strError + e.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                strError = "Error when querying data [tticol011]. Try again or contact your administrator \n " + strSentencia;
                log.escribirError(strError + Console.Out.NewLine + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name);
            }
            return(consulta);
        }
        public static string VerificarWorkorder(string PDNO)
        {
            string        strError    = string.Empty;
            Ent_tticol011 ObjTicol011 = new Ent_tticol011();

            ObjTicol011.pdno   = PDNO.ToUpper().Trim();
            ObjTicol011.Acceso = false;
            HttpContext.Current.Session["PDNO"] = ObjTicol011.pdno;

            DataTable dtTicol011 = Tticol011.invLabelRegrind_listaRegistrosOrdenParam(ref ObjTicol011, ref strError);

            if (dtTicol011.Rows.Count > 0)
            {
                DataTable dtTicol011N = Tticol011.invLabel_listaRegistrosOrdenMaquina_Workorder(ref ObjTicol011, ref strError);

                if (dtTicol011N.Rows.Count > 0)
                {
                    HttpContext.Current.Session["PDNO"] = PDNO;
                }
                else
                {
                    ObjTicol011.Error     = true;
                    ObjTicol011.TypeMsgJs = "label";

                    ObjTicol011.ErrorMsg = WorkOrdernotActive;
                }
            }
            else
            {
                ObjTicol011.Error     = true;
                ObjTicol011.TypeMsgJs = "label";

                ObjTicol011.ErrorMsg = WorkOrderdoesntexist;
            }

            return(JsonConvert.SerializeObject(ObjTicol011));
        }