public bool AddUser(EntityLayer.User usr) { mycontext.Users.Add(usr); int result = mycontext.SaveChanges(); return(result > 0); }
public async Task <EntityLayer.User> DeleteUser(EntityLayer.User entity) { UnitOfWork.UserRepository.Remove(entity); await UnitOfWork.CommitChangesAsync(); return(entity); }
public EntityLayer.User CheckUser(string userid, string password) { EntityLayer.User dbuser = (from u in mycontext.Users where u.MedicareID == userid && u.Password == password select u).SingleOrDefault(); return(dbuser); }
public EntityLayer.User GetUserByID(string UserID) { int uid1 = Convert.ToInt32(UserID); EntityLayer.User dbUser = (from u in mycontext.Users where u.UserID == uid1 select u).SingleOrDefault(); return(dbUser); }
public bool UpdateUser(EntityLayer.User usr) { EntityLayer.User dbUser = (from u in mycontext.Users where u.UserID == usr.UserID select u).SingleOrDefault(); mycontext.Entry(dbUser).State = System.Data.Entity.EntityState.Modified; int result = mycontext.SaveChanges(); return(result > 0); }
public bool EditUser(EntityLayer.User usr) { List <EntityLayer.User> user = new List <EntityLayer.User>(); EntityLayer.User dbuser = (from u in mycontext.Users where u.UserID == usr.UserID select u).SingleOrDefault(); dbuser.Name = usr.Name; dbuser.Password = usr.Password; mycontext.Entry(dbuser).State = System.Data.Entity.EntityState.Modified; int result = mycontext.SaveChanges(); return(result > 0); }
#pragma warning disable 1998 public async override global::System.Threading.Tasks.Task ExecuteAsync() { #line 1 "F:\Tesis\AgroApp-Tesis\AgroAppWebSite\AgroAppWeb\AgroAppWeb\Views\Structure\_TopNavbar.cshtml" EntityLayer.User u = (EntityLayer.User)ViewData["user"]; #line default #line hidden BeginContext(69, 287, true); WriteLiteral(@"<div class=""row border-bottom""> <nav class=""navbar navbar-static-top"" role=""navigation"" style=""margin-bottom: 0""> <div class=""navbar-header""> <a class=""navbar-minimalize minimalize-styl-2 btn btn-primary "" href=""#""><i class=""fa fa-bars""></i> </a> "); EndContext(); BeginContext(356, 292, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "8646c6399e614a5e815942fd4cb09e39", async() => { BeginContext(427, 214, true); WriteLiteral("\r\n <div class=\"form-group\">\r\n <input type=\"text\" placeholder=\"Search for something...\" class=\"form-control\" name=\"top-search\" id=\"top-search\">\r\n </div>\r\n "); EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.FormTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.RenderAtEndOfFormTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1); __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.Method = (string)__tagHelperAttribute_2.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_2); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_3); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(648, 198, true); WriteLiteral("\r\n </div>\r\n <ul class=\"nav navbar-top-links navbar-right\">\r\n <li>\r\n <span class=\"m-r-sm text-muted welcome-message\" data-i18n=\"topnav.welcometext\">Bienvenido "); EndContext(); BeginContext(847, 6, false); #line 16 "F:\Tesis\AgroApp-Tesis\AgroAppWebSite\AgroAppWeb\AgroAppWeb\Views\Structure\_TopNavbar.cshtml" Write(u.Name); #line default #line hidden EndContext(); BeginContext(853, 1, true); WriteLiteral(" "); EndContext(); BeginContext(855, 10, false); #line 16 "F:\Tesis\AgroApp-Tesis\AgroAppWebSite\AgroAppWeb\AgroAppWeb\Views\Structure\_TopNavbar.cshtml" Write(u.LastName); #line default #line hidden EndContext(); BeginContext(865, 511, true); WriteLiteral(@"</span> </li> <li class=""dropdown""> <a class=""dropdown-toggle count-info"" data-toggle=""dropdown"" href=""#""> <i class=""fa fa-envelope""></i> <span class=""label label-warning"">16</span> </a> <ul class=""dropdown-menu dropdown-messages""> <li> <div class=""dropdown-messages-box""> <a href=""#"" class=""pull-left""> "); EndContext(); BeginContext(1376, 58, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("img", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagOnly, "9d2d062aaa624116b6f0dd8bed6cc396", async() => { } ); __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_4); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_5); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_6); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(1434, 707, true); WriteLiteral(@" </a> <div class=""media-body""> <small class=""pull-right"">46h ago</small> <strong>Mike Loreipsum</strong> started following <strong>Monica Smith</strong>. <br> <small class=""text-muted"">3 days ago at 7:58 pm - 10.06.2014</small> </div> </div> </li> <li class=""divider""></li> <li> <div class=""dropdown-messages-box""> <a href=""#"" class=""pull-left""> "); EndContext(); BeginContext(2141, 58, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("img", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagOnly, "ee9450c229094c508027e395835d68bc", async() => { } ); __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_4); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_5); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_7); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(2199, 722, true); WriteLiteral(@" </a> <div class=""media-body ""> <small class=""pull-right text-navy"">5h ago</small> <strong>Chris Johnatan Overtunk</strong> started following <strong>Monica Smith</strong>. <br> <small class=""text-muted"">Yesterday 1:21 pm - 11.06.2014</small> </div> </div> </li> <li class=""divider""></li> <li> <div class=""dropdown-messages-box""> <a href=""#"" class=""pull-left""> "); EndContext(); BeginContext(2921, 63, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("img", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagOnly, "4370c964879244a39b5137b5bc07f252", async() => { } ); __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_4); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_5); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_8); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(2984, 2869, true); WriteLiteral(@" </a> <div class=""media-body ""> <small class=""pull-right"">23h ago</small> <strong>Monica Smith</strong> love <strong>Kim Smith</strong>. <br> <small class=""text-muted"">2 days ago at 2:30 am - 11.06.2014</small> </div> </div> </li> <li class=""divider""></li> <li> <div class=""text-center link-block""> <a href=""#""> <i class=""fa fa-envelope""></i> <strong>Read All Messages</strong> </a> </div> </li> </ul> </li> <li class=""dropdown""> <a class=""dropdown-toggle count-info"" data-toggle=""dropdown"" href=""#""> <i cla"); WriteLiteral(@"ss=""fa fa-bell""></i> <span class=""label label-primary"">8</span> </a> <ul class=""dropdown-menu dropdown-alerts""> <li> <a href=""#""> <div> <i class=""fa fa-envelope fa-fw""></i> You have 16 messages <span class=""pull-right text-muted small"">4 minutes ago</span> </div> </a> </li> <li class=""divider""></li> <li> <a href=""#""> <div> <i class=""fa fa-twitter fa-fw""></i> 3 New Followers <span class=""pull-right text-muted small"">12 minutes ago</span> </div> </a> </li> <li class=""divider""></li> <li> "); WriteLiteral(@" <a href=""#""> <div> <i class=""fa fa-upload fa-fw""></i> Server Rebooted <span class=""pull-right text-muted small"">4 minutes ago</span> </div> </a> </li> <li class=""divider""></li> <li> <div class=""text-center link-block""> <a href=""#""> <strong>See All Alerts</strong> <i class=""fa fa-angle-right""></i> </a> </div> </li> </ul> </li> <li> "); EndContext(); BeginContext(5853, 143, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "9b6910df122d41d4827ec7d780f4a3ae", async() => { BeginContext(5908, 84, true); WriteLiteral("\r\n <i class=\"fa fa-sign-out\"></i> Cerrar Sesión\r\n "); EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Controller = (string)__tagHelperAttribute_9.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_9); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_10.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_10); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(5996, 54, true); WriteLiteral("\r\n </li>\r\n </ul>\r\n </nav>\r\n</div>"); EndContext(); }
public async Task <EntityLayer.User> GetUser(EntityLayer.User entity) { return(await Task.Run(() => { return UnitOfWork.UserRepository.Get(entity); })); }