Example #1
0
 public ByARpt CambiarEstadoCronograma(vPCRONOGRAMAS Reg, Entities ctx)
 {
     try
     {
         ByARpt res = new ByARpt();
         PCRONOGRAMAS crono = ctx.PCRONOGRAMAS.Where(t => t.ID == Reg.ID).FirstOrDefault();
         crono.EST_ACT = Reg.EST_ACT;
         crono.OBS_SEG = Reg.OBS_SEG;
         ctx.SaveChanges();
         res.Error = false;
         res.Mensaje = "OperaciĆ³n Realizada Satisfactoriamente";
         return res;
     }
     catch (Exception e)
     {
         ByARpt res = new ByARpt();
         res.Error = true;
         res.Mensaje = e.Message;
         return res;
     }
 }
Example #2
0
 public ByARpt CambiarEstadoCronograma(vPCRONOGRAMAS Reg)
 {
     return mCrono.CambiarEstadoCronograma(Reg);
 }
 private void SegActividades(vPCRONOGRAMAS item)
 {
     PCRONOGRAMAS crono = lstC.Where(t => t.ID == item.ID).FirstOrDefault();
     if (crono.EST_ACT != item.EST_ACT || crono.OBS_SEG != item.OBS_SEG)
     {//si hay cambios
         crono.EST_ACT = item.EST_ACT;
         crono.OBS_SEG = item.OBS_SEG;
         crono.FEC_MOD = DateTime.Now;
         crono.USAP_MOD = USUARIO;
         ctx.Entry(crono).State = EntityState.Modified;
     }
 }
        private void AddActividades(vPCRONOGRAMAS item, decimal id)
        {

            string vig = oPC.VIG_CON.ToString();
            PACTIVIDADES a = ctx.PACTIVIDADES.Where(t => t.VIGENCIA == vig && t.COD_ACT == item.COD_ACT).FirstOrDefault();
            string EST_ACT = item.FECHAI != null ? "0001" : "0000";
            PCRONOGRAMAS objCrono = new PCRONOGRAMAS
            {
                ID = id,
                COD_ACT = a.COD_ACT,
                COD_TPRO = a.COD_TPRO,
                EST_ACT = EST_ACT,
                EST_PROC = a.EST_PROC,
                FEC_REG = DateTime.Now,
                NOM_ACT = a.NOM_ACT,
                NOTIFICAR = a.NOTIFICAR,
                NUM_PROC = oPC.PRO_SEL_NRO,
                OBLIGATORIO = a.OBLIGATORIO,
                OCUPADO = a.OCUPADO,
                USAP = oPC.USUARIO,
                UBICACION = a.UBICACION,
                FECHAI = item.FECHAI,
                HORAI = item.HORAI,
                MIN_I = item.MIN_I,
                FECHAF = item.FECHAF,
                MIN_F = item.MIN_F,
                ANULADO = "N"
            };
            ctx.PCRONOGRAMAS.Add(objCrono);
        }
 private void UpdActividades(vPCRONOGRAMAS item)
 {
     PCRONOGRAMAS crono = ctx.PCRONOGRAMAS.Find(item.ID);
     if (item.IS_ANULAR)
     {
         crono.ANULADO = "S";
     }
     else
     {
         if (item.EST_ACT == "0000")
         {
             if (item.FECHAI != null)
             {
                 crono.EST_ACT = "0001";
                 crono.FECHAI = item.FECHAI;
                 crono.HORAI = item.HORAI;
                 crono.MIN_I = item.MIN_I;
                 crono.FECHAF = item.FECHAF;
                 crono.MIN_F = item.MIN_F;
             }
             else
             {
                 crono.EST_ACT = "0000";
                 crono.FECHAI = null;
                 crono.HORAI = null;
                 crono.MIN_I = null;
                 crono.FECHAF = null;
                 crono.MIN_F = null;
             }
         }
     }
     ctx.Entry(crono).State = EntityState.Modified;
 }
 private void UpdActividades(vPCRONOGRAMAS item)
 {
         PCRONOGRAMAS crono = ctx.PCRONOGRAMAS.Find(item.ID);
         crono.FECHAI = item.FECHAI;
         crono.HORAI = item.HORAI;
         crono.MIN_I = item.MIN_I;
         crono.FECHAF = item.FECHAF;
         crono.MIN_F = item.MIN_F;
         crono.USAP_MOD = USUARIO;
         ctx.Entry(crono).State = EntityState.Modified;
 }
 public ByARpt PostCronograma(PCronogramasDTO p )
 {
     List<vPCRONOGRAMAS> lst= new List<vPCRONOGRAMAS>();
     vPCRONOGRAMAS Actividad = new vPCRONOGRAMAS { ID = p.ID, NUM_PROC =p.NUM_PROC, OBS_SEG = p.OBS_SEG, EST_ACT="0003" };
     lst.Add(Actividad);
     ProcesosBLL epBLL = new ProcesosBLL();
     ByARpt rpt = epBLL.SegCronograma(lst, p.NUM_PROC, p.USUARIO);
     return rpt;
 }
 public ByARpt PostAplazarCrono(PCronogramasDTO p)
 {
     p.FECHAI = new DateTime(p.mFEFHAI.Year, p.mFEFHAI.Month, p.mFEFHAI.Day);
     p.FECHAF = new DateTime(p.mFEFHAF.Year, p.mFEFHAF.Month, p.mFEFHAF.Day);
     List<vPCRONOGRAMAS> lst = new List<vPCRONOGRAMAS>();
     vPCRONOGRAMAS Actividad = new vPCRONOGRAMAS
     {
         ID = p.ID,
         NUM_PROC = p.NUM_PROC,
         FECHAF = p.FECHAF,
         FECHAI = p.FECHAI,
         HORAI = p.HORAI,
         HORAF = p.HORAF
     };
     lst.Add(Actividad);
     ProcesosBLL epBLL = new ProcesosBLL();
     ByARpt rpt = epBLL.AplazarCronograma(lst, p.NUM_PROC, p.USUARIO);
     return rpt;
 }