/// <summary> /// Se carga la SubMarca /// </summary> /// <param name="idMarca"></param> /// <returns>Objeto de SubMarca</returns> public static Models.SubMarcas CargaSubMarca(int idSubMarca) { var objSubMarca = new Models.SubMarcas(); object[] paramArray = new object[3]; try { paramArray[0] = null; paramArray[1] = idSubMarca; paramArray[2] = null; var db = DatabaseFactory.CreateDatabase("SQLStringConn"); using (IDataReader dataReader = db.ExecuteReader("usp_CargarSubMarcas", paramArray)) { while (dataReader.Read()) { objSubMarca = new Models.SubMarcas() { id = Convert.ToInt32(dataReader["idSubMarca"]), codigoSubMarca = Convert.ToString(dataReader["codigoSubMarca"]), piezasSubMarcas = Convert.ToInt32(dataReader["piezasSubMarca"]), pesoSubMarcas = Convert.ToDouble(dataReader["pesoSubMarca"]), kgmSubMarcas = Convert.ToDouble(dataReader["kgmSubMarca"]), totalLASubMarcas = Convert.ToDouble(dataReader["totalLASubMarca"]), anchoSubMarcas = Convert.ToDouble(dataReader["anchoSubMarca"]), corteSubMarcas = Convert.ToDouble(dataReader["corteSubMarca"]), longitudSubMarcas = Convert.ToDouble(dataReader["longitudSubMarca"]), idEstatus = Convert.ToInt32(dataReader["idEstatus"]), fechaCreacion = Convert.ToString(dataReader["fechaCreacion"]), idMarca = Convert.ToInt32(dataReader["idMarca"]), claseSubMarca = Convert.ToString(dataReader["claseSubMarca"]), gradoSubMarcas = Convert.ToString(dataReader["gradoSubMarca"]), perfilSubMarca = Convert.ToString(dataReader["perfilSubMarca"]), totalSubMarcas = Convert.ToDouble(dataReader["totalSubMarca"]), alturaSubMarcas = Convert.ToDouble(dataReader["alturaSubMarca"]), }; } } } catch (Exception exp) { throw new ApplicationException(exp.Message, exp); } return objSubMarca; }
public ActionResult Nuevo() { var objSubMarcas = new Models.SubMarcas() { fechaCreacion = DateTime.Now.ToString("dd/MM/yyyy"), idEstatus = 1 }; ViewBag.Titulo = "Nuevo"; return PartialView("_Nuevo", objSubMarcas); }