public ActionResult Create(M_Nota_Credito_Venta MNCV) { //Obteniendo el valor del Master int Maestro = Convert.ToInt16(Session["M_V"]); m_venta MV = db.m_venta.Where(p => p.id == Maestro).Single(); nota_credito_venta NCV = new nota_credito_venta(); NCV.CLIENTE_id = MNCV.cliente; NCV.plazo = Convert.ToDateTime(MNCV.plazo); NCV.fecha_extendido = MV.fecha_venta; NCV.M_VENTA_id = MV.id; NCV.estado = true; db.nota_credito_venta.Add(NCV); db.SaveChanges(); Session["M_V"] = null; return RedirectToAction("Index"); }
// // GET: /NotaCreditoVenta/Create public ActionResult Create() { int rol = Convert.ToInt16(Session["Rol_id"]); bool Validacion = SEG.ValidarAcceso(rol, "NotaCreditoVenta", "Create"); if (Validacion) { //Obteniendo el valor del Master Compra int Maestro = Convert.ToInt16(Session["M_V"]); ViewBag.Cliente_id = db.cliente.ToList(); m_venta MV = db.m_venta.Where(p => p.id == Maestro).Single(); M_Nota_Credito_Venta MNCV = new M_Nota_Credito_Venta(); MNCV.MV = MV; return View(MNCV); } else { return RedirectToAction("Error"); } }