public ActionResult DeleteConfirmed(int id)
        {
            formapago formapago = db.formapago.Find(id);

            db.formapago.Remove(formapago);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "id,descripcion")] formapago formapago)
 {
     if (ModelState.IsValid)
     {
         db.Entry(formapago).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(formapago));
 }
        public ActionResult Create([Bind(Include = "id,descripcion")] formapago formapago)
        {
            if (ModelState.IsValid)
            {
                db.formapago.Add(formapago);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(formapago));
        }
        // GET: formapagoes/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            formapago formapago = db.formapago.Find(id);

            if (formapago == null)
            {
                return(HttpNotFound());
            }
            return(View(formapago));
        }
Exemple #5
0
        private object CrearConvenio(object unaFormaPago, object unConvenioPago)
        {
            int ix = 0;
            //if (this.dgrLista.CurrentRow.Index == this.dgrLista.NewRowIndex)
            //ix = this.dgrLista.NewRowIndex;
            //else
            //ix = this.dgrLista.CurrentRow.Index;

            bool   nuevo        = false;
            object convenioPago = null;

            e.ListaValores.Clear();
            e.TipoEvento = TipoEvento.Obtener;
            this.OnValores(e);

            if (unConvenioPago == null)
            {
                nuevo = true;
            }
            if (e.ListaValores != null)
            {
                if (e.ListaValores.Count > 0)
                {
                    formapago formaPago = (formapago)unaFormaPago;

                    Type unTipo = Type.GetType("Proveedores." + formaPago.modulo + ", Proveedores");
                    if (unTipo == null)
                    {
                        MessageBox.Show("Modulo no definido para forma de pago " + formaPago.descripcion, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                    else
                    {
                        Form unForm = (Form)Activator.CreateInstance(unTipo);
                        ((IControlesUsuario)unForm).Cargar(ref unConvenioPago, null, e.ListaValores);
                        //ENFOQUE A OTRO CONTROL PARA DEFINIR ESTADO SIN ACCION PARA EL GRID
                        unForm.ShowDialog();
                        convenioPago = ((IControlesUsuario)unForm).Objeto;
                        if (convenioPago != null)
                        {
                            this.checkBox1.Focus();
                            ((conveniopago)convenioPago).fkformaspago = formaPago;
                            if (nuevo)
                            {
                                this.listaConvenios.Add((conveniopago)convenioPago);
                            }
                            else
                            {
                                this.dgrLista.InvalidateRow(this.dgrLista.CurrentRow.Index);
                            }

                            ix = this.dgrLista.NewRowIndex;

                            this.TotalPagado = this.listaConvenios.Sum(x => x.valor);
                            e.TotalPagado    = this.TotalPagado;
                            e.TipoEvento     = TipoEvento.Setear;
                            this.OnValores(e);
                        }

                        unForm = null;
                    }
                }
            }
            //ESTABLECEMOS ENFOQUE AL GRID EN LA CELDA NUEVA PARA OTRA FORMA DE PAGO
            this.dgrLista.CurrentCell = this.dgrLista.Rows[ix].Cells[1];
            this.dgrLista.Focus();
            return(convenioPago);
        }
Exemple #6
0
 public int Borrar(formapago item)
 {
     return(item.BorrarObjetoT());
 }
Exemple #7
0
 public int Grabar(formapago item)
 {
     return(item.GrabarObjetoT <formapago, string>(null));
 }