public ActionResult Consultar(string IdFormaPago = "", bool Exito = false) { fa_formaPago_Info model = bus_forma.GetInfo(IdFormaPago); if (model == null) { return(RedirectToAction("Index")); } #region Permisos seg_Menu_x_Empresa_x_Usuario_Info info = bus_permisos.get_list_menu_accion(Convert.ToInt32(SessionFixed.IdEmpresa), SessionFixed.IdUsuario, "Facturacion", "FormaPago", "Index"); if (model.Estado == false) { info.Modificar = false; info.Anular = false; } model.Nuevo = (info.Nuevo == true ? 1 : 0); model.Modificar = (info.Modificar == true ? 1 : 0); model.Anular = (info.Anular == true ? 1 : 0); #endregion if (Exito) { ViewBag.MensajeSuccess = MensajeSuccess; } return(View(model)); }
public Boolean GuardarDB(fa_formaPago_Info Info, ref string msjError) { try { using (EntitiesFacturacion Context = new EntitiesFacturacion()) { var Address = new fa_formaPago(); Address.IdFormaPago = Info.IdFormaPago; Address.nom_FormaPago = Info.nom_FormaPago; Context.fa_formaPago.Add(Address); Context.SaveChanges(); } return(true); } catch (Exception ex) { string arreglo = ToString(); tb_sis_Log_Error_Vzen_Data oDataLog = new tb_sis_Log_Error_Vzen_Data(); tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now); mensaje = ex.ToString(); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); msjError = mensaje; throw new Exception(ex.ToString()); } }
public bool ModificarDB(fa_formaPago_Info info) { try { using (Entities_facturacion Context = new Entities_facturacion()) { fa_formaPago Entity = Context.fa_formaPago.Where(q => q.IdFormaPago == info.IdFormaPago).FirstOrDefault(); if (Entity == null) { return(false); } Entity.nom_FormaPago = info.nom_FormaPago; Entity.IdUsuarioUltMod = info.IdUsuarioUltMod; Entity.Fecha_UltMod = DateTime.Now; Context.SaveChanges(); } return(true); } catch (Exception) { throw; } }
public bool ModificarDB(fa_formaPago_Info info, ref string msjError) { try { EntitiesFacturacion context = new EntitiesFacturacion(); var contenido = context.fa_formaPago.FirstOrDefault(var => var.IdFormaPago == info.IdFormaPago); if (contenido != null) { contenido.nom_FormaPago = info.nom_FormaPago; context.SaveChanges(); } return(true); } catch (Exception ex) { string arreglo = ToString(); tb_sis_Log_Error_Vzen_Data oDataLog = new tb_sis_Log_Error_Vzen_Data(); tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now); mensaje = ex.ToString(); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); msjError = mensaje; throw new Exception(ex.ToString()); } }
public List <fa_formaPago_Info> Get_List_fa_formaPago() { try { List <fa_formaPago_Info> Lst = new List <fa_formaPago_Info>(); EntitiesFacturacion oEnti = new EntitiesFacturacion(); var Query = oEnti.fa_formaPago.ToList(); foreach (var item in Query) { fa_formaPago_Info Obj = new fa_formaPago_Info { IdFormaPago = item.IdFormaPago, nom_FormaPago = item.nom_FormaPago, }; Lst.Add(Obj); } return(Lst); } catch (Exception ex) { string arreglo = ToString(); tb_sis_Log_Error_Vzen_Data oDataLog = new tb_sis_Log_Error_Vzen_Data(); tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now); mensaje = ex.ToString(); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); throw new Exception(ex.ToString()); } }
public fa_formaPago_Info GetInfo(string IdFormaPago) { try { fa_formaPago_Info info = new fa_formaPago_Info(); using (Entities_facturacion Context = new Entities_facturacion()) { fa_formaPago Entity = Context.fa_formaPago.Where(q => q.IdFormaPago == IdFormaPago).FirstOrDefault(); if (Entity == null) { return(null); } info = new fa_formaPago_Info { IdFormaPago = Entity.IdFormaPago, nom_FormaPago = Entity.nom_FormaPago, Estado = Entity.Estado }; } return(info); } catch (Exception) { throw; } }
public ActionResult Index() { #region Validar Session if (string.IsNullOrEmpty(SessionFixed.IdTransaccionSession)) { return(RedirectToAction("Login", new { Area = "", Controller = "Account" })); } SessionFixed.IdTransaccionSession = (Convert.ToDecimal(SessionFixed.IdTransaccionSession) + 1).ToString(); SessionFixed.IdTransaccionSessionActual = SessionFixed.IdTransaccionSession; #endregion #region Permisos seg_Menu_x_Empresa_x_Usuario_Info info = bus_permisos.get_list_menu_accion(Convert.ToInt32(SessionFixed.IdEmpresa), SessionFixed.IdUsuario, "Facturacion", "FormaPago", "Index"); ViewBag.Nuevo = info.Nuevo; ViewBag.Modificar = info.Modificar; ViewBag.Anular = info.Anular; #endregion fa_formaPago_Info model = new fa_formaPago_Info { IdTransaccionSession = Convert.ToDecimal(SessionFixed.IdTransaccionSession), }; var lst = bus_forma.get_list(true); Lista_FormaPago.set_list(lst, model.IdTransaccionSession); return(View(model)); }
public ActionResult Modificar(fa_formaPago_Info model) { model.IdUsuarioUltMod = SessionFixed.IdUsuario; if (!bus_forma.ModificarDB(model)) { return(View(model)); } return(RedirectToAction("Consultar", new { IdFormaPago = model.IdFormaPago, Exito = true })); }
public ActionResult Anular(string IdFormaPago = "") { fa_formaPago_Info model = bus_forma.GetInfo(IdFormaPago); if (model == null) { return(RedirectToAction("Index")); } return(View(model)); }
public ActionResult Anular(fa_formaPago_Info model) { model.IdUsuarioUltAnu = SessionFixed.IdUsuario; if (!bus_forma.AnularDB(model)) { return(View(model)); } return(RedirectToAction("Index")); }
public bool AnularDB(fa_formaPago_Info info) { try { return(odata.AnularDB(info)); } catch (Exception) { throw; } }
public ActionResult Nuevo() { #region Permisos seg_Menu_x_Empresa_x_Usuario_Info info = bus_permisos.get_list_menu_accion(Convert.ToInt32(SessionFixed.IdEmpresa), SessionFixed.IdUsuario, "Facturacion", "FormaPago", "Index"); if (!info.Nuevo) { return(RedirectToAction("Index")); } #endregion fa_formaPago_Info model = new fa_formaPago_Info(); return(View(model)); }
public bool ModificarDB(fa_formaPago_Info info, ref string msjError) { try { return(Data.GuardarDB(info, ref msjError)); } catch (Exception ex) { Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message); throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "ConsultaGeneral", ex.Message), ex) { EntityType = typeof(fa_formaPago_Bus) }; } }
public ActionResult Anular(string IdFormaPago = "") { #region Permisos seg_Menu_x_Empresa_x_Usuario_Info info = bus_permisos.get_list_menu_accion(Convert.ToInt32(SessionFixed.IdEmpresa), SessionFixed.IdUsuario, "Facturacion", "FormaPago", "Index"); if (!info.Anular) { return(RedirectToAction("Index")); } #endregion fa_formaPago_Info model = bus_forma.GetInfo(IdFormaPago); if (model == null) { return(RedirectToAction("Index")); } return(View(model)); }
public ActionResult Nuevo(fa_formaPago_Info model) { model.IdUsuario = SessionFixed.IdUsuario; if (bus_forma.ValidarIdFormaPago(model.IdFormaPago)) { ViewBag.mensaje = "El código ya se encuentra registrado"; return(View(model)); } if (!bus_forma.GuardarDB(model)) { return(View(model)); } return(RedirectToAction("Consultar", new { IdFormaPago = model.IdFormaPago, Exito = true })); }
public bool GuardarDB(fa_formaPago_Info info) { try { using (Entities_facturacion Context = new Entities_facturacion()) { Context.fa_formaPago.Add(new fa_formaPago { IdFormaPago = info.IdFormaPago, nom_FormaPago = info.nom_FormaPago, Estado = true, IdUsuario = info.IdUsuario, Fecha_Transac = DateTime.Now }); Context.SaveChanges(); } return(true); } catch (Exception) { throw; } }
public pagosPago_info() { formaPago = new pagosPago(); Tipo_Forma_Pago = new fa_formaPago_Info(); }
public ActionResult Nuevo() { fa_formaPago_Info model = new fa_formaPago_Info(); return(View(model)); }