Exemplo n.º 1
0
        private string Planilla(string plani)
        {
            string result = "";
            int    output;

            if (int.TryParse(plani, out output))
            {
                mRECC = dRECC.GetPlani(plani);
                if (mRECC != null)
                {
                    result = "OK";
                }
                else
                {
                    mRDCC = dRDCC.GetInfo(plani);
                    if (mRDCC != null)
                    {
                        ActualizaRECC(mRDCC.DCONSO);
                        mRECC = dRECC.GetPlani(plani);
                        if (mRECC != null)
                        {
                            result = "OK";
                        }
                    }
                }
            }
            return(result);
        }
Exemplo n.º 2
0
        public string Updatedata(RDCC rdcc)
        {
            string        res;
            StringBuilder query = new StringBuilder();

            query.Append(" UPDATE RDCC");
            query.Append(" SET");
            query.Append(" DLDPFX = '" + rdcc.DLDPFX + "', DLDOCN = " + rdcc.DLDOCN);
            query.Append(" WHERE DPEDID = " + rdcc.DPEDID + " AND DLINEA = " + rdcc.DLINEA);

            try
            {
                db.Execute(query.ToString(), rdcc);
                res = "OK";
            }
            catch (iDB2SQLErrorException ex)
            {
                res = ex.Message;
            }
            catch (iDB2Exception ex)
            {
                res = ex.Message;
            }
            catch (Exception ex)
            {
                res = ex.Message;
            }
            return(res);
        }
Exemplo n.º 3
0
        private string ChkTruePlanilla(string xPlanilla, string pSender, string pHora, string regA)
        {
            string result = "";
            string ECELOK = "";

            mRDCC = dRDCC.GetInfo(xPlanilla);
            if (mRDCC != null)
            {
                mRRCC.RPLANI  = xPlanilla;
                mRRCC.HCONSO  = mRDCC.DCONSO;
                mRRCC.RSTSC   = mRDCC.HSTS;
                mRRCC.RFECREP = pHora;
                mRRCC.RREPORT = xPlanilla + " Fin de Entrega";
                mRRCC.RCRTUSR = pSender;
                result        = dRRCC.AddRPLANI(mRRCC);
                if (result == "OK")
                {
                    mRHCC         = null;
                    mRHCC         = new RHCC();
                    mRHCC.RREPORT = xPlanilla + " Fin de Entrega";
                    mRHCC.RFECREP = pHora;
                    mRHCC.HCONSO  = mRDCC.DCONSO;
                    result        = dRHCC.UpdateHREPORT(mRHCC);
                    if (result == "OK")
                    {
                        if (pSender.Trim() == mRDCC.HCELU.Replace(" ", "").Replace("-", ""))
                        {
                            ECELOK = "1";
                        }
                        result = dRECC.UpdateESTS2(pHora, xPlanilla, ECELOK);
                        if (result == "OK")
                        {
                            if (regA == "0" || regA == "" || regA == null)
                            {
                                ActualizaRECC(mRDCC.DCONSO);
                            }
                            result = dRECC.UpdateConso2(mRDCC.DCONSO);
                            if (result == "OK")
                            {
                                lmRECC = dRECC.GetData3(mRDCC.DCONSO);
                                if (lmRECC == null || lmRECC.Count == 0)
                                {
                                    mRHCC         = null;
                                    mRHCC         = new RHCC();
                                    mRHCC.HFESTAD = pHora;
                                    mRHCC.HCONSO  = mRDCC.DCONSO;
                                    result        = dRHCC.UpdateHESTAD(mRHCC);
                                }
                            }
                        }
                    }
                }
            }

            return(result);
        }