Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            plan plan = db.plan.Find(id);

            db.plan.Remove(plan);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
        public ActionResult Details(int id = 0)
        {
            plan plan = db.plan.Find(id);

            if (plan == null)
            {
                return(HttpNotFound());
            }
            return(View(plan));
        }
Example #3
0
        public void LoadPlan(plan pl)
        {
            _bloc = pl.bklist;
            _capteur = pl.fblist;
            _loco = pl.lclist;
            _signal = pl.sglist;
            _route = pl.stlist;
            _switch = pl.swlist;
            _loc = new ObservableCollection<lc>(pl.lclist);

        }
Example #4
0
 public ActionResult Edit(plan plan)
 {
     if (ModelState.IsValid)
     {
         db.Entry(plan).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Create", "Inmunizacion"));
     }
     ViewBag.pla_id = plan.pla_id;
     return(PartialView(plan));
 }
Example #5
0
 public static void EditPlan(PlanEntity detail)
 {
     using (fitnessEntities dbe = new DAL.fitnessEntities())
     {
         plan plan = dbe.plans.Find(detail.plan_id);
         plan.plan_name        = detail.plan_name;
         plan.plan_cost        = detail.plan_cost;
         plan.plan_period      = detail.plan_period;
         dbe.Entry(plan).State = System.Data.Entity.EntityState.Modified;
         dbe.SaveChanges();
     }
 }
Example #6
0
        public ActionResult Create(int id)
        {
            plan plan = db.plan.Find(id);

            if (plan != null)
            {
                return(RedirectToAction("Edit", new { id = id }));
            }
            historia historia = db.historia.Find(id);

            ViewBag.pla_id = id;
            ViewBag.pac_id = historia.his_paciente;
            return(PartialView());
        }
Example #7
0
        public static PlanEntity Detailplan(string Id)
        {
            PlanEntity planEntity = new Entity.PlanEntity();

            using (fitnessEntities dbe = new fitnessEntities())
            {
                plan plan = dbe.plans.Where(o => o.plan_id.Equals(Id)).SingleOrDefault();
                planEntity.plan_id     = plan.plan_id;
                planEntity.plan_name   = plan.plan_name;
                planEntity.plan_cost   = plan.plan_cost;
                planEntity.plan_period = plan.plan_period;
            }
            return(planEntity);
        }
Example #8
0
 public static bool Delplan(string Id)
 {
     using (fitnessEntities dbe = new fitnessEntities())
     {
         var cst = dbe.customers.Where(o => o.plan_id == Id).ToList();
         if (cst.Count == 0)
         {
             plan plan = dbe.plans.Where(o => o.plan_id.Equals(Id)).SingleOrDefault();
             dbe.plans.Remove(plan);
             dbe.SaveChanges();
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }
Example #9
0
        /// <summary>
        /// Converts this instance of <see cref="plan"/> to an instance of <see cref="planDto"/>.
        /// </summary>
        /// <param name="entity"><see cref="plan"/> to convert.</param>
        public static planDto ToDTO(this plan entity)
        {
            if (entity == null)
            {
                return(null);
            }

            var dto = new planDto();

            dto.i_PlanId = entity.i_PlanId;
            dto.v_OrganizationSeguroId = entity.v_OrganizationSeguroId;
            dto.v_ProtocoloId          = entity.v_ProtocoloId;
            dto.v_IdUnidadProductiva   = entity.v_IdUnidadProductiva;
            dto.i_EsDeducible          = entity.i_EsDeducible;
            dto.i_EsCoaseguro          = entity.i_EsCoaseguro;
            dto.d_Importe = entity.d_Importe;

            entity.OnDTO(dto);

            return(dto);
        }
Example #10
0
        /// <summary>
        /// Converts this instance of <see cref="planDto"/> to an instance of <see cref="plan"/>.
        /// </summary>
        /// <param name="dto"><see cref="planDto"/> to convert.</param>
        public static plan ToEntity(this planDto dto)
        {
            if (dto == null)
            {
                return(null);
            }

            var entity = new plan();

            entity.i_PlanId = dto.i_PlanId;
            entity.v_OrganizationSeguroId = dto.v_OrganizationSeguroId;
            entity.v_ProtocoloId          = dto.v_ProtocoloId;
            entity.v_IdUnidadProductiva   = dto.v_IdUnidadProductiva;
            entity.i_EsDeducible          = dto.i_EsDeducible;
            entity.i_EsCoaseguro          = dto.i_EsCoaseguro;
            entity.d_Importe = dto.d_Importe;

            dto.OnEntity(entity);

            return(entity);
        }
Example #11
0
        protected void GuardarRegistro(object sender, EventArgs e)
        {
            int IdSucursal = Mgr_Sucursal.Set_IdSucursalDDl(ObjUsuario, ddlSucursal);

            plan tabla = new plan();

            ObjUsuario.Error = CRUD.Delete_Fila(tabla, Mgr_Documento.Get_Plan(IdSucursal));

            plan nuevo = new plan()
            {
                id_sucursal = IdSucursal,
                nombre      = txtPlanEmergencia.Text,
                tipo        = "Emergencias"
            };

            ObjUsuario.Error = CRUD.Add_Fila(nuevo);

            if (ObjUsuario.Error)
            {
                cargarPlan();
                Modal.MostrarAlertaEdit(phAlerta, divAlerta, lbAlerta, ObjUsuario.Error, txtBuscar);
            }
        }
Example #12
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            int IdSucursal = Mgr_Sucursal.Set_IdSucursalDDl(ObjUsuario, ddlSucursal);

            plan tabla = new plan();

            ObjUsuario.Error = CRUD.Delete_Fila(tabla, Mgr_Documento.Get_Plan(IdSucursal));

            plan nuevo = new plan()
            {
                id_sucursal = IdSucursal,
                nombre      = txtPlanInduccion.Text
            };

            ObjUsuario.Error = CRUD.Add_Fila(nuevo);

            if (ObjUsuario.Error)
            {
                cargarPlan();
            }

            Modal.MostrarAlertaAdd(phAlerta, divAlerta, lbAlerta, ObjUsuario.Error, txtPlanInduccion);
        }
Example #13
0
 public void stor(int input,int output)
 {
     plan plan = new plan(input);
     Assert.AreEqual(plan.aa,input);
 }