public ActionResult Modificar(int IdEmpresa = 0, int IdRubro = 0) { pre_rubro_Info model = bus_Rubro.GetInfo(IdEmpresa, IdRubro); if (model == null) { return(RedirectToAction("Index")); } cargar_RubroTipo(IdEmpresa); model.AsignaCuentaRubro = cargar_permiso_asignacion_cuenta(IdEmpresa, SessionFixed.IdUsuario); return(View(model)); }
public ActionResult EditingAddNew([ModelBinder(typeof(DevExpressEditorsBinder))] pre_PresupuestoDet_Info info_PresupuestoDet) { int IdEmpresa = Convert.ToInt32(Session["IdEmpresa"]); if (info_PresupuestoDet != null) { if (info_PresupuestoDet.IdRubro != 0) { pre_rubro_Info info_Rubro = bus_Rubro.GetInfo(IdEmpresa, info_PresupuestoDet.IdRubro); if (info_Rubro != null) { info_PresupuestoDet.Descripcion = info_Rubro.Descripcion; } } } Lista_PresupuestoDet.AddRow(info_PresupuestoDet, Convert.ToDecimal(SessionFixed.IdTransaccionSessionActual)); var model = Lista_PresupuestoDet.get_list(Convert.ToDecimal(SessionFixed.IdTransaccionSessionActual)); return(PartialView("_GridViewPartial_PresupuestoDet", model)); }
public static void FileUploadComplete(object sender, DevExpress.Web.FileUploadCompleteEventArgs e) { #region Variables pre_rubro_Bus bus_rubro = new pre_rubro_Bus(); pre_PresupuestoDet_List ListaDet = new pre_PresupuestoDet_List(); List <pre_PresupuestoDet_Info> Lista_Det = new List <pre_PresupuestoDet_Info>(); int cont = 0; decimal IdTransaccionSession = Convert.ToDecimal(SessionFixed.IdTransaccionSessionActual); int IdEmpresa = Convert.ToInt32(SessionFixed.IdEmpresa); #endregion Stream stream = new MemoryStream(e.UploadedFile.FileBytes); if (stream.Length > 0) { IExcelDataReader reader = null; reader = ExcelReaderFactory.CreateOpenXmlReader(stream); var SecDet = 1; #region Presupuesto while (reader.Read()) { if (!reader.IsDBNull(0) && cont > 0) { var IdRubroDet = Convert.ToInt32(reader.GetValue(0)); pre_rubro_Info infoRubro = bus_rubro.GetInfo(IdEmpresa, IdRubroDet); pre_PresupuestoDet_Info info = new pre_PresupuestoDet_Info { IdEmpresa = IdEmpresa, Secuencia = SecDet++, IdRubro = IdRubroDet, Descripcion = infoRubro.Descripcion, Monto = Convert.ToDouble(reader.GetValue(1)), }; Lista_Det.Add(info); } else { cont++; } } ListaDet.set_list(Lista_Det, IdTransaccionSession); #endregion } }