public Boolean EliminarDB(ro_tabla_Impu_Renta_Info info) { try { using (EntitiesRoles rol = new EntitiesRoles()) { var Quer = (from q in rol.ro_tabla_Impu_Renta where q.Secuencia == info.Secuencia select q); if (Quer.Count() > 0) { ro_tabla_Impu_Renta dato = rol.ro_tabla_Impu_Renta.First(v => v.Secuencia == info.Secuencia); rol.ro_tabla_Impu_Renta.Remove(dato); rol.SaveChanges(); } } return(true); } catch (Exception ex) { string array = 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(), "", array, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.InnerException + " " + ex.Message; throw new Exception(ex.InnerException.ToString()); } }
public ActionResult Modificar(ro_tabla_Impu_Renta_Info info) { try { if (ModelState.IsValid) { if (!bus_imp_renta.modificarDB(info)) { return(View(info)); } else { return(RedirectToAction("Index")); } } else { return(View(info)); } } catch (Exception) { throw; } }
public ro_tabla_Impu_Renta_Info Get_Info_FraccionBasica(int anio, ref string msg) { ro_tabla_Impu_Renta_Info info = new ro_tabla_Impu_Renta_Info(); try { using (EntitiesRoles db = new EntitiesRoles()) { var consultar = from q in db.ro_tabla_Impu_Renta where q.AnioFiscal == anio && q.FraccionBasica == 0 && q.ImpFraccionBasica == 0 && q.Por_ImpFraccion_Exce == 0 select q; foreach (var item in consultar) { info.AnioFiscal = item.AnioFiscal; info.Secuencia = item.Secuencia; info.FraccionBasica = Convert.ToDouble(item.FraccionBasica); info.ExcesoHasta = Convert.ToDouble(item.ExcesoHasta); info.ImpFraccionBasica = Convert.ToDouble(item.ImpFraccionBasica); info.Por_ImpFraccion_Exce = Convert.ToDouble(item.Por_ImpFraccion_Exce); } } return(info); } catch (Exception ex) { string array = 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(), "", array, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.InnerException + " " + ex.Message; throw new Exception(ex.InnerException.ToString()); } }
public ActionResult Nuevo(ro_tabla_Impu_Renta_Info info) { try { if (ModelState.IsValid) { int IdEmpresa = Convert.ToInt32(SessionFixed.IdEmpresa); if (!bus_imp_renta.guardarDB(info)) { return(View(info)); } else { return(RedirectToAction("Index")); } } else { return(View(info)); } } catch (Exception) { throw; } }
public Boolean GrabarDB(ro_tabla_Impu_Renta_Info info) { try { EliminarDB(info); using (EntitiesRoles rol = new EntitiesRoles()) { ro_tabla_Impu_Renta db = new ro_tabla_Impu_Renta(); db.AnioFiscal = info.AnioFiscal; db.Secuencia = info.Secuencia; db.FraccionBasica = info.FraccionBasica; db.ExcesoHasta = info.ExcesoHasta; db.ImpFraccionBasica = info.ImpFraccionBasica; db.Por_ImpFraccion_Exce = info.Por_ImpFraccion_Exce; rol.ro_tabla_Impu_Renta.Add(db); rol.SaveChanges(); } return(true); } catch (Exception ex) { string array = 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(), "", array, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.InnerException + " " + ex.Message; throw new Exception(ex.InnerException.ToString()); } }
public List <ro_tabla_Impu_Renta_Info> Get_List_tabla_Impu_Renta() { List <ro_tabla_Impu_Renta_Info> Lst = new List <ro_tabla_Impu_Renta_Info>(); try { using (EntitiesRoles rol = new EntitiesRoles()) { var consultar = from q in rol.ro_tabla_Impu_Renta orderby q.Secuencia select q; foreach (var item in consultar) { ro_tabla_Impu_Renta_Info info = new ro_tabla_Impu_Renta_Info(); info.AnioFiscal = item.AnioFiscal; info.Secuencia = item.Secuencia; info.FraccionBasica = Convert.ToDouble(item.FraccionBasica); info.ExcesoHasta = Convert.ToDouble(item.ExcesoHasta); info.ImpFraccionBasica = Convert.ToDouble(item.ImpFraccionBasica); info.Por_ImpFraccion_Exce = Convert.ToDouble(item.Por_ImpFraccion_Exce); Lst.Add(info); } } return(Lst); } catch (Exception ex) { string array = 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(), "", array, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.InnerException + " " + ex.Message; throw new Exception(ex.InnerException.ToString()); } }
public ro_tabla_Impu_Renta_Info get_info(int AnioFiscal, int Secuencia) { try { ro_tabla_Impu_Renta_Info info = new ro_tabla_Impu_Renta_Info(); using (Entities_rrhh Context = new Entities_rrhh()) { ro_tabla_Impu_Renta Entity = Context.ro_tabla_Impu_Renta.FirstOrDefault(q => q.AnioFiscal == AnioFiscal && q.Secuencia == Secuencia); if (Entity == null) { return(null); } info = new ro_tabla_Impu_Renta_Info { AnioFiscal = Entity.AnioFiscal, Secuencia = Entity.Secuencia, FraccionBasica = Entity.FraccionBasica, ExcesoHasta = Entity.ExcesoHasta, ImpFraccionBasica = Entity.ImpFraccionBasica, Por_ImpFraccion_Exce = Entity.Por_ImpFraccion_Exce }; } return(info); } catch (Exception) { throw; } }
public bool modificarDB(ro_tabla_Impu_Renta_Info info) { try { using (Entities_rrhh Context = new Entities_rrhh()) { ro_tabla_Impu_Renta Entity = Context.ro_tabla_Impu_Renta.FirstOrDefault(q => q.AnioFiscal == info.AnioFiscal && q.Secuencia == info.Secuencia); if (Entity == null) { return(false); } Entity.FraccionBasica = info.FraccionBasica; Entity.ImpFraccionBasica = info.ImpFraccionBasica; Entity.Por_ImpFraccion_Exce = info.Por_ImpFraccion_Exce; Entity.ExcesoHasta = info.ExcesoHasta; Context.SaveChanges(); } return(true); } catch (Exception) { throw; } }
public bool guardarDB(ro_tabla_Impu_Renta_Info info) { try { using (Entities_rrhh Context = new Entities_rrhh()) { ro_tabla_Impu_Renta Entity = new ro_tabla_Impu_Renta { AnioFiscal = info.AnioFiscal, Secuencia = info.Secuencia = get_id(info.AnioFiscal), FraccionBasica = info.FraccionBasica, ExcesoHasta = info.ExcesoHasta, ImpFraccionBasica = info.ImpFraccionBasica, Por_ImpFraccion_Exce = info.Por_ImpFraccion_Exce }; Context.ro_tabla_Impu_Renta.Add(Entity); Context.SaveChanges(); } return(true); } catch (Exception) { throw; } }
public bool anularDB(ro_tabla_Impu_Renta_Info info) { try { return(odata.anularDB(info)); } catch (Exception) { throw; } }
public ActionResult Nuevo() { try { ro_tabla_Impu_Renta_Info info = new ro_tabla_Impu_Renta_Info(); return(View(info)); } catch (Exception) { throw; } }
private void gridViewTablaIR_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) { try { IRInfo = new ro_tabla_Impu_Renta_Info(); IRInfo = gridViewTablaIR.GetFocusedRow() as ro_tabla_Impu_Renta_Info; } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString()); } }
public Boolean GrabarTablaImpu(ro_tabla_Impu_Renta_Info info) { try { return(data.GrabarDB(info)); } 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("", "GrabarTablaImpu", ex.Message), ex) { EntityType = typeof(ro_Tabla_Impu_Renta_Bus) }; } }
public ActionResult Anular(ro_tabla_Impu_Renta_Info info) { try { if (!bus_imp_renta.anularDB(info)) { return(View(info)); } else { return(RedirectToAction("Index")); } } catch (Exception) { throw; } }
// GET: RRHH/Division 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 ro_tabla_Impu_Renta_Info model = new ro_tabla_Impu_Renta_Info { IdTransaccionSession = Convert.ToDecimal(SessionFixed.IdTransaccionSession) }; List <ro_tabla_Impu_Renta_Info> lista = bus_imp_renta.get_list(); Lista_ImpRenta.set_list(lista, Convert.ToDecimal(SessionFixed.IdTransaccionSession)); return(View(model)); }
public Boolean GETINFO() { try { IRinfo = new ro_tabla_Impu_Renta_Info(); IRinfo.AnioFiscal = Convert.ToInt32(cmbAnioFiscal.EditValue); IRinfo.Secuencia = (SETINFO_ == null)?IRBus.GETSECUENCIA():SETINFO_.Secuencia; IRinfo.FraccionBasica = Convert.ToDouble(txtFraccion.EditValue); IRinfo.ExcesoHasta = Convert.ToDouble(txtExceso.EditValue); IRinfo.ImpFraccionBasica = Convert.ToDouble(txtImpuesto.EditValue); IRinfo.Por_ImpFraccion_Exce = Convert.ToDouble(txtPorcentaje.EditValue); return(true); } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString()); return(false); } }
public bool anularDB(ro_tabla_Impu_Renta_Info info) { try { using (Entities_rrhh Context = new Entities_rrhh()) { ro_tabla_Impu_Renta Entity = Context.ro_tabla_Impu_Renta.FirstOrDefault(q => q.AnioFiscal == info.AnioFiscal && q.Secuencia == info.Secuencia); if (Entity == null) { return(false); } Context.ro_tabla_Impu_Renta.Remove(Entity); Context.SaveChanges(); } return(true); } catch (Exception) { throw; } }