public ActionResult ScattaFoto(string myIDPerizia, string IDPerito, string IDSpedizione, string IDMeteo, string IDTP, string aIDTrasportatore, string aIDTipoRotabile, string aIDModelloCasa, string ErrMess = "", bool IsUpdate = false) { var model = new Models.HomeModel(); var myFoto = (from f in db.WEB_AUTO_FOTO where f.IDPerizia == myIDPerizia select f); model.WEB_AUTO_FOTO = myFoto.ToList(); UpdateModel(myFoto); ViewBag.IDPerito = IDPerito; ViewBag.IDSpedizione = IDSpedizione; ViewBag.IDMeteo = IDMeteo; ViewBag.IDTP = IDTP; ViewBag.aIDTrasportatore = aIDTrasportatore; ViewBag.aIDTipoRotabile = aIDTipoRotabile; ViewBag.aIDModelloCasa = aIDModelloCasa; ViewBag.myIDPerizia = myIDPerizia; ViewBag.ErrMess = ErrMess; ViewBag.IsUpdate = IsUpdate; return(View("ScattaFoto", myFoto)); //ViewBag.myIDPerizia = myIDPerizia; //return View(); }
public ActionResult CancellaPDFSpedizione(string IDSpedizione, string nomefile) { var sql = @"DELETE FROM WEB_AUTO_PDF WHERE IDPerizia = @IDDocumento"; int myRecordCounter = db.Database.ExecuteSqlCommand(sql, new SqlParameter("@IDDocumento", IDSpedizione)); string fullPath = Request.MapPath("~/DocumentiXTelai/PDF/" + nomefile); if (System.IO.File.Exists(fullPath)) { System.IO.File.Delete(fullPath); } var model = new Models.HomeModel(); var myFoto = (from f in db.WEB_AUTO_PDF where f.IDPerizia == IDSpedizione select f); model.WEB_AUTO_PDF = myFoto.ToList(); //ViewBag.IDTelaio = myIDPerizia; return(RedirectToAction("ScattaPDFSpedizione", "Documenti", new { IDSpedizione = IDSpedizione })); //return View("ScattaFoto", myIDPerizia); }
public ActionResult Index() { //var orderId = 2; //var order = new Order(); List <Order> orders = new List <Order>(); using (var orderActions = new OrderActions()) { //order = orderActions.GetOrder(orderId); orders = orderActions.GetCompletedOrders(); } var vm = new Models.HomeModel { DisplayName = base.DisplayName, Orders = orders }; if (Request.IsAuthenticated) { var user = User.Identity.Name; } return(View(vm)); }
public ActionResult UploadFoto(IEnumerable <HttpPostedFileBase> files, string myIDPerizia, string IDPerito, string IDSpedizione, string IDMeteo, string IDTP, string aIDTrasportatore, string aIDTipoRotabile, string aIDModelloCasa, string ErrMess = "", bool IsUpdate = false) { string filename = ""; string path = ""; foreach (var file in files) { if (file != null) { filename = System.IO.Path.GetFileName(file.FileName); path = System.IO.Path.Combine(Server.MapPath("~/DocumentiXTelai/Foto"), filename); if (file != null) { file.SaveAs(path); } int cnt = 0; try { cnt = (int)(from m in db.WEB_AUTO_FOTO where m.IDPerizia == myIDPerizia select m.Prog).Max(); } catch { } cnt++; var sql = @"INSERT INTO WEB_AUTO_FOTO (IDPerizia, FileName,Prog) Values (@IDPerizia, @FileName,@Prog)"; int noOfRowInserted = db.Database.ExecuteSqlCommand(sql, new SqlParameter("@IDPerizia", myIDPerizia), new SqlParameter("@FileName", filename), new SqlParameter("@Prog", cnt)); } } var model = new Models.HomeModel(); var myFoto = (from f in db.WEB_AUTO_FOTO where f.IDPerizia == myIDPerizia select f); model.WEB_AUTO_FOTO = myFoto.ToList(); UpdateModel(myFoto); ViewBag.myIDPerizia = myIDPerizia; ViewBag.IDPerito = IDPerito; ViewBag.IDSpedizione = IDSpedizione; ViewBag.IDMeteo = IDMeteo; ViewBag.IDTP = IDTP; ViewBag.aIDTrasportatore = aIDTrasportatore; ViewBag.aIDTipoRotabile = aIDTipoRotabile; ViewBag.aIDModelloCasa = aIDModelloCasa; ViewBag.ErrMess = ErrMess; ViewBag.IsUpdate = IsUpdate; return(View("ScattaFoto", myFoto)); }
private HomeModel GetHomeModel(FormCollection formCollection = null) { var model = new Models.HomeModel(); model.StretchTableName = Constants.StretchTableName; string remoteDatabaseName = StretchDbService.GetDatabaseName(Constants.StretchDBAzureConnectionString); string remoteTableName = StretchDbService.GetRemoteTableName(Constants.StretchTableName, Constants.StretchDbOnPremiseConnectionString, remoteDatabaseName); model.StretchEnabled = !string.IsNullOrWhiteSpace(remoteTableName); model.IsDatabaseOnline = SqlAlwaysOnService.IsServerConnected(Constants.SQLAlwaysOnConnectionString); if (SqlAlwaysOnService.IsPrimaryDatabase(Constants.SqlAlwaysOnPrimaryConnectionString)) { model.AlwaysOnPrimaryDatabaseServer = SqlAlwaysOnService.GetServerName(Constants.SqlAlwaysOnPrimaryConnectionString); model.AlwaysOnSecondaryDatabaseServer = SqlAlwaysOnService.GetServerName(Constants.SqlAlwaysOnSecondaryConnectionString);; } else { model.AlwaysOnPrimaryDatabaseServer = SqlAlwaysOnService.GetServerName(Constants.SqlAlwaysOnSecondaryConnectionString); model.AlwaysOnSecondaryDatabaseServer = SqlAlwaysOnService.GetServerName(Constants.SqlAlwaysOnPrimaryConnectionString);; } model.TotalSpaceUsed = StretchDbService.GetUsedSpace(Constants.StretchTableName, Constants.StretchDbOnPremiseConnectionString, StorageMode.ALL); model.RemoteSpaceUsed = StretchDbService.GetUsedSpace(Constants.StretchTableName, Constants.StretchDbOnPremiseConnectionString, StorageMode.REMOTE_ONLY); model.LocalSpaceUsed = StretchDbService.GetUsedSpace(Constants.StretchTableName, Constants.StretchDbOnPremiseConnectionString, StorageMode.LOCAL_ONLY); return(model); }
//public ActionResult Index(string usr, string Opt1, string CercaTarga, string SearchLocation) //{ // if (usr != null) // Session["User"] = usr; // if (usr == null) // usr = Session["User"].ToString(); // bool isAuth = false; // if (usr != String.Empty) // { // string UserName = ""; // string cookieName = FormsAuthentication.FormsCookieName; //Find cookie name // HttpCookie cookie = HttpContext.Request.Cookies[cookieName]; //Get the cookie by it's name // FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(cookie.Value); //Decrypt it // UserName = ticket.Name; //You have the UserName! // if (usr == UserName) // { // ViewBag.Messaggio = "BENE il cookie corrisponde!"; // //ViewBag.Messaggio = personaggio; // isAuth = true; // using (AUTOSDUEntities val = new AUTOSDUEntities()) // { // Session["Status"] = ""; // var fromDatabaseEF = new SelectList(val.Luoghi_vw.ToList(), "ID", "DescrITA"); // ViewData["Luoghi"] = fromDatabaseEF; // } // if (String.IsNullOrEmpty(CercaTarga)) // { // return View(); // } // else if (!String.IsNullOrEmpty(CercaTarga)) // { // var model = new Models.HomeModel(); // var telai = from s in db.AT_ListaPratiche_vw // where s.Targa.ToString() == CercaTarga // select s; // model.AT_ListaPratiche_vw = telai.ToList(); // return View("ElencoTelai", model); // } // else // { // return View(); // } // } // else // { // ViewBag.Messaggio = "il cookie contenente lo 'username' non corrisponde allo User della queryString!"; // isAuth = false; // return View("IncorrectLogin"); // } // } // else // { // string UserName = ""; // string cookieName = FormsAuthentication.FormsCookieName; //Find cookie name // HttpCookie cookie = HttpContext.Request.Cookies[cookieName]; //Get the cookie by it's name // FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(cookie.Value); //Decrypt it // UserName = ticket.Name; //You have the UserName! // } // return View(); //} public ActionResult Index(string Opt1, string CercaTarga, string SearchLocation) { using (AUTOSDUEntities val = new AUTOSDUEntities()) { Session["Status"] = ""; var fromDatabaseEF = new SelectList(val.Luoghi_vw.ToList(), "ID", "DescrITA"); ViewData["Luoghi"] = fromDatabaseEF; } if (String.IsNullOrEmpty(CercaTarga)) { return(View()); } else if (!String.IsNullOrEmpty(CercaTarga)) { var model = new Models.HomeModel(); var telai = from s in db.AT_ListaPratiche_vw where s.Targa.ToString() == CercaTarga select s; model.AT_ListaPratiche_vw = telai.ToList(); return(View("ElencoTelai", model)); } else { return(View()); } //return RedirectToAction("DoRefresh", "Home"); }
public ActionResult CercaStoriaTelaio(string aTelaio) { string myTelaio = aTelaio.ToUpper(); var model = new Models.HomeModel(); var Chassis1 = from m in db.WEB_ListaPerizieFlat_MVC_vw where m.Telaio == myTelaio select m; model.WEB_ListaPerizieFlat_MVC_vw = Chassis1.ToList(); ViewBag.Chassis1 = myTelaio; var Chassis2 = from m in db.WEB_ListaPerizieFlat_TMP_vw where m.Telaio == myTelaio select m; model.WEB_ListaPerizieFlat_TMP_vw = Chassis2.ToList(); var Chassis3 = from m in db.WEB_ListaPerizieFlat_DEF_vw where m.Telaio == myTelaio select m; model.WEB_ListaPerizieFlat_DEF_vw = Chassis3.ToList().OrderByDescending(m => m.DataPerizia); return(View(model)); }
public async Task <ActionResult> Index() { Models.HomeModel model = new Models.HomeModel(); model.SignInName = AuthHelper.GetUserId(); if (!string.IsNullOrEmpty(model.SignInName)) { try { var accessToken = await AuthHelper.GetUserAccessTokenSilentAsync(SettingsHelper.AADGraphResourceId); if (accessToken == null) { return(Redirect("/Account/SignIn?force=1")); } var response = await UserInfo.GetUserInfoAsync(SettingsHelper.AADGraphResourceId, model.SignInName, accessToken); if (null != response) { model.DisplayName = response.DisplayName; model.OneDriveUrl = response.MySite; } else { model.DisplayName = "Error getting data from Microsoft Graph."; } } catch (Exception ex) { model.DisplayName = ex.ToString(); } } return(View(model)); }
public ActionResult DraftRun(String name, String phone, String bank_code, String bank_name, String account_code, String account_name, decimal target_money, String end_datetime, String title, String introduction, String content) { DateTime now_time = DateTime.Now; DateTime end_datetime_2 = Convert.ToDateTime(end_datetime); this.homemodel.DraftRunMen(name, phone, now_time); int menber_id = this.homemodel.lastid; this.homemodel = new Models.HomeModel(); this.homemodel.DraftRunB(menber_id, bank_code, bank_name, account_code, account_name, now_time); int bank_id = this.homemodel.lastid; this.homemodel = new Models.HomeModel(); this.homemodel.DraftRunP(menber_id, bank_id, now_time); int proposal_id = this.homemodel.lastid; this.homemodel = new Models.HomeModel(); this.homemodel.DraftRunPV(proposal_id, title, introduction, content, end_datetime_2, now_time); this.homemodel = new Models.HomeModel(); this.homemodel.DraftRunPG(proposal_id, target_money, now_time); String sb = ""; sb = sb + "{"; sb = sb + "\"p_id\": " + proposal_id.ToString() + " "; sb = sb + "}"; return(Content(sb)); }
public ActionResult Images(int ID) { var model = new Models.HomeModel(); int myIDTelaio = 0; if (TempData["myIDTelaio"] != null) { myIDTelaio = (int)TempData["myIDTelaio"]; } else { myIDTelaio = ID; } var foto = from s in db.RPC_FotoXTelaio where s.IDTelaio.ToString() == ID.ToString() select s; model.RPC_FotoXTelaio = foto.ToList(); TempData["myIDTelaio"] = myIDTelaio; return(View(foto)); }
public ActionResult CancellaPDF(int?IDDocumento, string myIDPerizia, string nomefile, string IDPerito, string IDSpedizione, string IDMeteo, string IDTP, string aIDTrasportatore, string aIDTipoRotabile, string aIDModelloCasa, bool IsUpdate = false) { var sql = @"DELETE FROM WEB_AUTO_PDF WHERE ID = @IDDocumento"; int myRecordCounter = db.Database.ExecuteSqlCommand(sql, new SqlParameter("@IDDocumento", IDDocumento)); string fullPath = Request.MapPath("~/DocumentiXTelai/PDF/" + nomefile); if (System.IO.File.Exists(fullPath)) { System.IO.File.Delete(fullPath); } var model = new Models.HomeModel(); var myFoto = (from f in db.WEB_AUTO_PDF where f.IDPerizia == myIDPerizia select f); model.WEB_AUTO_PDF = myFoto.ToList(); //ViewBag.IDTelaio = myIDPerizia; return(RedirectToAction("ScattaPDF", "Documenti", new { myIDPerizia = myIDPerizia, IDPerito = IDPerito, IDSpedizione = IDSpedizione, IDMeteo = IDMeteo, IDTP = IDTP, aIDTrasportatore = aIDTrasportatore, aIDTipoRotabile = aIDTipoRotabile, aIDModelloCasa = aIDModelloCasa, IsUpdate = IsUpdate })); //return View("ScattaFoto", myIDPerizia); }
public HomeModule() { Get["/"] = parameters => { Models.HomeModel model = new Models.HomeModel(); return View["Index", model]; }; }
public async Task <ActionResult> Index(int?id) { var model = new Models.HomeModel(); model.RegulationsJSON = await FetchRegulationData(id); return(View(model)); }
/// <summary> /// Retourne la vue "Library.cshtml", avec un modèle HomeModel.cs contenant les livres qui sont dans la librairie de l'utilisateur, filtrés selon les paramètres entrés /// </summary> /// <param name="searchString">Mots clés de recherche</param> /// <param name="category">Catégorie sélectionnée</param> /// <returns>La vue "Library.cshtml", avec un modèle HomeModel</returns> public ActionResult Library(string searchString = null, string category = null) { ProjetFinal.Models.HomeModel model = new Models.HomeModel(); string connString = ConfigurationManager.ConnectionStrings["AtlasDB"].ConnectionString; using (var conn = new OleDbConnection(connString)) { string query = "select * from [Books] where [Id] in (select [BookId] from [Sales] where [UserId] = (select [Id] from [Users] where [Username] = @username))"; if (!string.IsNullOrWhiteSpace(searchString)) { query += " and [Title] like @searchString"; } else if (!string.IsNullOrWhiteSpace(category)) { query += " and [Category] = @category"; } query += " order by [Rating] desc, [Title] asc"; OleDbCommand searchCmd = new OleDbCommand(query, conn); searchCmd.Parameters.AddWithValue("@username", User.Identity.GetUserName()); if (!string.IsNullOrWhiteSpace(searchString)) { searchCmd.Parameters.AddWithValue("@searchString", "%" + searchString + "%"); } else if (!string.IsNullOrWhiteSpace(category)) { searchCmd.Parameters.AddWithValue("@category", category); model.currentCategory = category; } OleDbCommand categoriesCmd = new OleDbCommand("select distinct [Category] from [Books]", conn); conn.Open(); var searchResultsTable = new DataTable(); using (var reader = searchCmd.ExecuteReader()) searchResultsTable.Load(reader); var categoriesTable = new DataTable(); using (var reader = categoriesCmd.ExecuteReader()) categoriesTable.Load(reader); conn.Close(); searchCmd.Dispose(); categoriesCmd.Dispose(); model.Books = Utils.deserialize(searchResultsTable); foreach (DataRow row in categoriesTable.Rows) { model.Categories.Add(row["Category"].ToString()); } } return(View(model)); }
public ActionResult Index(int?page) { var pageItems = Consumables.ConsumableCollection().OrderByDescending(c => c.Created); var articleModels = pageItems as IList <Models.ArticleModel> ?? pageItems.ToList(); var pager = new Pagination("Home", articleModels.Count, page); var items = articleModels.Skip((int)((pager.CurrentPage - 1) * pager.PageSize)).Take((int)pager.PageSize); var viewModel = new Models.HomeModel(items, pager); return(View(viewModel)); }
public IActionResult Save(Models.HomeModel model) { context.FooBars.RemoveRange(context.FooBars); // Remove any existing context.FooBars.Add(new FooBar { Text = model.Foo }); context.SaveChanges(); return(Content("OK")); }
public IActionResult Index() { var item = context.FooBars.Select(f => f.Text).SingleOrDefault(); var model = new Models.HomeModel { Foo = item, }; return(View(model: model)); }
public ActionResult Index(int?page) { var pageItems = ArticleItems(); var articleModels = pageItems as IList <Models.ArticleModel> ?? pageItems.ToList(); var pager = new Pagination("Home", articleModels.Count, page); var items = articleModels.Skip((int)((pager.CurrentPage - 1) * pager.PageSize)).Take((int)pager.PageSize); var viewModel = new Models.HomeModel(items, pager); return(View(viewModel)); }
public ActionResult PrintList() { var model = new Models.HomeModel(); string mySearch = TempData["mySearch"] as string; string myLotto = TempData["myLotto"] as string; string Scelta1 = Session["Scelta1"].ToString(); if (Scelta1 == "TUTTE") { var telai = from s in db.RPC_Telai where s.IDCantiere.ToString() == mySearch || //&& s.IDLotto.ToString() == SearchLotto s.IDCantiere.ToString() == "1804" || s.IDCantiere.ToString() == "1805" select s; model.RPC_Telai = telai.ToList(); } else if (Scelta1 == "CHIUSE") { var telai = from s in db.RPC_Telai where s.IDCantiere.ToString() == mySearch || //&& s.IDLotto.ToString() == SearchLotto s.IDCantiere.ToString() == "1804" || s.IDCantiere.ToString() == "1805" && s.IsFinished == true select s; model.RPC_Telai = telai.ToList(); } else if (Scelta1 == "APERTE") { var telai = from s in db.RPC_Telai where s.IDCantiere.ToString() == mySearch || //&& s.IDLotto.ToString() == SearchLotto s.IDCantiere.ToString() == "1804" || s.IDCantiere.ToString() == "1805" && s.IsFinished == false select s; model.RPC_Telai = telai.ToList(); } else { var telai = from s in db.RPC_Telai where s.IDCantiere.ToString() == mySearch || //&& s.IDLotto.ToString() == SearchLotto s.IDCantiere.ToString() == "1804" || s.IDCantiere.ToString() == "1805" select s; model.RPC_Telai = telai.ToList(); } TempData["mySearch"] = mySearch; TempData["myLotto"] = myLotto; return(View("PrintList", model)); }
public Models.HomeModel GetHome(string otherOptions) { var model = new Models.HomeModel { Description = "これは MVVM の実装方法を理解するための ASP.NET SPA サンプルです。このサンプルデータは動的に Web API から取得されています。(" + DateTime.Now.ToString("yyyyMMdd HHmmss") + ")", Version = "Ver." + Assembly.GetExecutingAssembly().GetName().Version.ToString() }; return(model); } // end function
public ActionResult Index(string Number, string Team) { Models.HomeModel model = new Models.HomeModel(Number, Team); try { DataAccess.InsertNumberForTeam(model.Number, model.Team); } catch (Exception e) { throw e; } return(View(model)); }
public ActionResult InvestRun(int p_id, String name, String phone, decimal invest_money) { DateTime now_time = DateTime.Now; this.homemodel.InvestIRun(p_id, name, phone, invest_money, now_time); this.homemodel = new Models.HomeModel(); this.homemodel.InvestRsetRun(p_id, invest_money); return(Content("ok")); }
public ActionResult UploadPDFSpedizione(IEnumerable <HttpPostedFileBase> files, string IDSpedizione) { string filename = ""; string path = ""; foreach (var file in files) { if (file != null) { filename = System.IO.Path.GetFileName(file.FileName); path = System.IO.Path.Combine(Server.MapPath("~/DocumentiXTelai/PDF"), filename); if (file != null) { file.SaveAs(path); } int cnt = 0; try { cnt = (int)(from m in db.WEB_AUTO_PDF where m.IDPerizia == IDSpedizione select m.Prog).Max(); } catch { } cnt++; var sql = @"INSERT INTO WEB_AUTO_PDF (IDPerizia, FileName,Prog) Values (@IDPerizia, @FileName,@Prog)"; int noOfRowInserted = db.Database.ExecuteSqlCommand(sql, new SqlParameter("@IDPerizia", IDSpedizione), new SqlParameter("@FileName", filename), new SqlParameter("@Prog", cnt)); } } var model = new Models.HomeModel(); var myFoto = (from f in db.WEB_AUTO_PDF where f.IDPerizia == IDSpedizione select f); model.WEB_AUTO_PDF = myFoto.ToList(); UpdateModel(myFoto); ViewBag.IDSpedizione = IDSpedizione; return(View("ScattaPDFSpedizione", myFoto)); }
public ActionResult ModificaDataPerizia(string aViaggio, string errMess = "") { var model = new Models.HomeModel(); var lista = (from m in db.WEB_Auto_ListaPerizieXSpedizione_vw where m.IDOriginale1 == aViaggio select m).ToList().OrderBy(s => s.DataPerizia); model.WEB_Auto_ListaPerizieXSpedizione_vw = lista; ViewBag.myViaggio = aViaggio; ViewBag.errMess = errMess; return(View(model)); }
public ActionResult MostraPDF(string aIDPerizia, string IDSpedizione, string IDTP) { var model = new Models.HomeModel(); var pdf = (from m in db.WEB_AUTO_PDF where m.IDPerizia == aIDPerizia select m).ToList(); model.WEB_AUTO_PDF = pdf; ViewBag.IDSpedizione = IDSpedizione; ViewBag.IDTP = IDTP; return(View(model)); }
public ActionResult VisualizzaPreload(string aViaggio) { var model = new Models.HomeModel(); var ListaTelai = from m in db.WEB_ListaPerizieFlat_MVC_vw where m.Viaggio == aViaggio where m.IDTipoPerizia == "C" select m; model.WEB_ListaPerizieFlat_MVC_vw = ListaTelai.ToList().OrderBy(s => s.Status); ViewBag.Viaggio = aViaggio; return(View(model)); }
public Models.HomeModel GetAccounts() { IEnumerable <Models.AccountModel> accounts = null; Models.HomeModel accountGroups = new Models.HomeModel(); try { using (var client = new HttpClient()) { client.BaseAddress = new Uri("https://frontiercodingtests.azurewebsites.net/api/accounts/getall"); ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; System.Net.ServicePointManager.Expect100Continue = false; //Called Member default GET All records //GetAsync to send a GET request // PutAsync to send a PUT request var responseTask = client.GetAsync(client.BaseAddress); responseTask.Wait(); //To store result of web api response. var result = responseTask.Result; //If success received if (result.IsSuccessStatusCode) { var readTask = result.Content.ReadAsAsync <IList <Models.AccountModel> >(); readTask.Wait(); accounts = readTask.Result; accountGroups.ActiveAccounts = accounts.Where(m => m.AccountStatusId == 0).ToList(); accountGroups.InactiveAccounts = accounts.Where(m => m.AccountStatusId == 1).ToList(); accountGroups.OverdueAccounts = accounts.Where(m => m.AccountStatusId == 2).ToList(); } else { //Error response received accounts = Enumerable.Empty <Models.AccountModel>(); ModelState.AddModelError(string.Empty, "Server error try after some time."); } } } catch (Exception ex) { var errorMessage = ex.Message; var stackTrace = ex.StackTrace; } return(accountGroups); }
public ActionResult CarouselFotoStoriche(string aIDPerizia, string aTelaio) { var model = new Models.HomeModel(); var foto = (from m in db.WEB_ListaPerizieFlat_DEF_vw where m.IDPerizia == aIDPerizia select m).ToList(); model.WEB_ListaPerizieFlat_DEF_vw = foto; ViewBag.NumFoto = foto[0].NumFoto; ViewBag.IDPErizia = foto[0].IDPerizia; ViewBag.Telaio = aTelaio; return(View(model)); }
public ActionResult Index() { var model = new Models.HomeModel { PageTitle = "Dashboard" }; var widgets = MefBootstrapper.GetInstances <MvcDashboard.Contracts.IWidget>(); foreach (var widget in widgets) { model.Widgets.Add(CreateWidget(widget)); } return(View(model)); }
// GET: ImportazioneDati public ActionResult Index() { var model = new Models.HomeModel(); var commesse = from co in db.Commesse join m in db.Clienti on co.IDCliente equals m.ID where m.IsActive == true //where co.ID == 2 select co; model.Commesse = commesse.ToList(); var elencoCommesse = new SelectList(model.Commesse.ToList().OrderBy(m => m.Descrizione), "ID", "Descrizione"); ViewData["Commesse"] = elencoCommesse; return View(); }
public ActionResult Index() { Models.HomeModel model = new Models.HomeModel(); model.TdList = new List <Models.ToDoItem>(); Models.ToDoItem task1 = new Models.ToDoItem("Go to store", "Need to go to the store and pick up some groceries", 1); Models.ToDoItem task2 = new Models.ToDoItem("Clean up leaves", "Clean up the leaves in the yard and place then in bags", 2); Models.ToDoItem task3 = new Models.ToDoItem("Mow the lawn", "After cleaning up the leaves, mow the lawn", 3); model.TdList.Add(task1); model.TdList.Add(task2); model.TdList.Add(task3); return(View(model)); }