public virtual System.Web.Mvc.ActionResult Edit(Models.Matters Matter) { Models.Matters originalItem = MyDatabaseContext.Matter.Find(Matter.Id); if (originalItem == null) { return(HttpNotFound()); } var foundedItem = MyDatabaseContext.Matter .Where(current => current.Id != Matter.Id) .Where(current => string.Compare(current.Name, Matter.Name, true) == 0) .FirstOrDefault(); if (foundedItem != null) { ModelState.AddModelError (key: "Name", errorMessage: "Name is exist! Please choose another one..."); } if (ModelState.IsValid) { originalItem.Name = Matter.Name; originalItem.CodePath = Matter.CodePath; MyDatabaseContext.SaveChanges(); return(RedirectToAction(MVC.Admin.Matters.Index())); } return(View(model: Matter)); }
public override System.Web.Mvc.ActionResult Edit(Models.Matters Matter) { var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Edit); ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "Matter", Matter); EditOverride(callInfo, Matter); return(callInfo); }
Create([System.Web.Mvc.Bind(Exclude = "Id")] Models.Matters Matter) { var foundedItem = MyDatabaseContext.Matter .Where(current => string.Compare(current.Name, Matter.Name, true) == 0) .FirstOrDefault(); if (foundedItem != null) { ModelState.AddModelError (key: "Name", errorMessage: "Name is exist! Please choose another one..."); } if (ModelState.IsValid) { MyDatabaseContext.Matter.Add(Matter); MyDatabaseContext.SaveChanges(); return(RedirectToAction(MVC.Admin.Matters.Index())); } return(View(model: Matter)); }
public void CompleteMatter() { var foundedItem = MyDatabaseContext.Matter .Where(current => current.Name != null) .ToList(); if (foundedItem.Count != 0) { return; } Models.Matters Field = new Models.Matters(); Field.Name = "Text Right Of Image"; Field.Part1 = "< div id = 'fh5co-about' class='fh5co-section'><div class='container'><div class='row'><div class='col-md-6 col-md-pull-4 img-wrap animate-box' data-animate-effect='fadeInLeft'><img src = '~/"; Field.Part2 = "' alt='Tamin sanaat'></ div >< div class='col-md-5 col-md-push-1 animate-box'><div class='section-heading'><h2>"; Field.Part3 = "</h2>< p > "; Field.Part4 = "</p> < p >< a href = '#' class='btn btn-primary btn-outline'>See more</a></p></div></div></div></div></div>"; MyDatabaseContext.Matter.Add(Field); MyDatabaseContext.SaveChanges(); Field.Name = "Text Without Image"; Field.Part1 = "< div class='col-md-12 fh5co-heading animate-box'><h2>"; Field.Part2 = "</ h2 >< div class='row'><div class='col-md-6'><p>"; Field.Part3 = "</p></div></div></div>"; MyDatabaseContext.Matter.Add(Field); MyDatabaseContext.SaveChanges(); Field.Name = "Perfect Products Item"; Field.Part1 = "<div class='col-md-3 col-sm-6 col-xs-6 col-xxs-12 fh5co-item-wrap animate-box'>< div class='fh5co-item"; Field.Part2 = "'><img src = '~/"; Field.Part3 = "' class='img-responsive' alt='Tamin sanaat'>< h3 > "; Field.Part4 = "</h3>< span class='fh5co-price'>"; Field.Part5 = "<sup>"; Field.Part6 = "</sup></span>< p > "; Field.Part7 = "</p></ div ></ div > "; MyDatabaseContext.Matter.Add(Field); MyDatabaseContext.SaveChanges(); Field.Name = "Perfect Products"; Field.Part1 = "<div id='fh5co-featured-menu' class='fh5co-section'>< div class='container'><div class='row'>"; Field.Part2 = "</div></div></div>"; MyDatabaseContext.Matter.Add(Field); MyDatabaseContext.SaveChanges(); Field.Name = "Text In Image"; Field.Part1 = "<div id='fh5co-featured-testimony' class='fh5co-section'>< div class='container'><div class='row'>"; Field.Part2 = " <div class='col-md-5 animate-box img-to-responsive animate-box' data-animate-effect='fadeInLeft'>< img src = '~/"; Field.Part3 = "' alt=''></ div >< div class='col-md-7 animate-box' data-animate-effect='fadeInRight'><blockquote><p>"; Field.Part4 = "</p>< p class='author'><cite>— Text In Image</cite></p></blockquote></div>"; Field.Part5 = "</div></div></div>"; MyDatabaseContext.Matter.Add(Field); MyDatabaseContext.SaveChanges(); Field.Name = "Slider"; Field.Part1 = "<div id='fh5co-slider' class='fh5co-section animate-box'>< div class='container'><div class='row'><div class='col-md-6 animate-box'>"; Field.Part2 = "</div></div></div>"; MyDatabaseContext.Matter.Add(Field); MyDatabaseContext.SaveChanges(); Field.Name = "Animate Box Slider"; Field.Part1 = "<div class='col-md-6 col-md-push-1 animate-box'>< aside id = 'fh5co-slider-wrwap' >< div class='flexslider'><ul class='slides'>"; Field.Part2 = "</ul></ div ></ aside ></ div > "; MyDatabaseContext.Matter.Add(Field); MyDatabaseContext.SaveChanges(); Field.Name = "Animate Box Slider Item"; Field.Part1 = "<li style='background-image: url("; Field.Part2 = ");'>< div class='overlay-gradient'></div><div class='container-fluid'><div class='row'><div class='col-md-12 col-md-offset-0 col-md-pull-10 slider-text slider-text-bg'><div class='slider-text-inner'><div class='desc'><h2>"; Field.Part3 = "</h2>< p > "; Field.Part4 = "</p>< p >< a href = '#' class='btn btn-primary btn-outline'>See More</a></p></div></div></div></div></div></li>"; MyDatabaseContext.Matter.Add(Field); MyDatabaseContext.SaveChanges(); Field.Name = "3 Image Animation Box"; Field.Part1 = "<div id='fh5co-blog' class='fh5co-section'>< div class='container'>"; Field.Part2 = "</div></div>"; MyDatabaseContext.Matter.Add(Field); MyDatabaseContext.SaveChanges(); Field.Name = ""; Field.Part1 = "<div class='row'>< div class='col-md-4'><div class='fh5co-blog animate-box'><a href = '#' class='blog-bg' style='background-image: url("; Field.Part2 = ");'></a>< div class='blog-text'><span class='posted_on'>"; Field.Part3 = "</span><h3><a href = '#' > "; Field.Part4 = "</a></h3><p>"; Field.Part5 = "</p>< ul class='stuff'><li><i class='icon-heart2'></i>"; Field.Part6 = "</li>< li >< i class='icon-eye2'></i>"; Field.Part7 = "</li>< p >< a href = '#' class='btn btn-primary btn-outline'>See More</a></p></ul></div></div></div>"; MyDatabaseContext.Matter.Add(Field); MyDatabaseContext.SaveChanges(); }
public virtual System.Web.Mvc.ViewResult Create() { Models.Matters defaultItem = new Models.Matters(); return(View(model: defaultItem)); }
partial void EditOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, Models.Matters Matter);