public Kullanici IsLoginSuccess(string user, string pass) { //Kullanici resultUser = Dbc.Kullanici.FirstOrDefault(); Kullanici resultUser = Dbc.Kullanici.Where(k => k.KulAdi.Equals(user) && k.KulSifre.Equals(pass)).FirstOrDefault(); if (resultUser != null) { resultUser.SonGirisTar = DateTime.Now; Dbc.Entry(resultUser).State = System.Data.Entity.EntityState.Modified; Dbc.SaveChanges(); // Log Giriş int yeniId = Dbc.LogGirisCikis.DefaultIfEmpty().Max(t => t == null ? 0 : t.Id + 1); Dbc.LogGirisCikis.Add(new LogGirisCikis() { Id = yeniId, KulaniciId = resultUser.Id, GirisTar = DateTime.Now, KullaniciAdi = resultUser.KulAdi }); Dbc.SaveChanges(); HttpContext.Current.Session.Add("UserId", resultUser.Id.ToString()); HttpContext.Current.Session.Add("UserName", resultUser.KulAdi.ToString()); HttpContext.Current.Session.Add("UserLevel", resultUser.Seviye.ToString()); //HttpContext.Current.Session.Add("TCSorgulasin", resultUser.TCSorgulasin); HttpContext.Current.Session.Add("DokumAlabilsin", resultUser.DokumAlabilsin); HttpContext.Current.Session.Add("AdSoyadSorgulasin", resultUser.AdSoyadSorgulasin); return(resultUser); } return(null); }
public async Task <IEntity[]> Scan(Dbc dbc) { this._processLength = 0; this._processed = 0; var allRefs = await this._library.Browse(ArtistStore.QueryString); var existsUris = dbc.Artists.Select(e => e.Uri).ToArray(); var newEntities = allRefs.Where(e => !existsUris.Contains(e.Uri)) .Select(e => new Artist() { Name = e.Name, LowerName = e.Name.ToLower(), Uri = e.Uri }).ToArray(); this._processLength = newEntities.Length; this._processed = this._processLength; if (0 < newEntities.Length) { dbc.Artists.AddRange(newEntities); } return(newEntities); }
protected void Button3_Click(object sender, EventArgs e) { if (TextBox3.Text == "") { ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "updateScript", "alert('Email can not be empty.')", true); return; } else if(TextBox4.Text==""||TextBox5.Text=="") { ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "updateScript", "alert('Password can not be empty.')", true); return; } else if (TextBox4.Text != TextBox5.Text) { ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "updateScript", "alert('Passwords must be matched.')", true); return; } Table_Customer customer = new Table_Customer(); customer.EmailAddress = TextBox3.Text; customer.Password = TextBox4.Text; customer.FirstName = customer.LastName = customer.PhoneNumber = customer.Sex = customer.CreditCardNumber = ""; Dbc dbc = new Dbc(); if (dbc.GetCustomer(customer.EmailAddress) == null) { dbc.AddCustomer(customer); Session["Customer"] = customer.EmailAddress; Panel1.Visible = false; } else { ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "updateScript", "alert('Email already Exist.')", true); return; } }
public Kullanici Ekle(Kullanici model) { int yeniId = Dbc.Kullanici.DefaultIfEmpty().Max(t => t == null ? 0 : t.Id + 1); Kullanici kullanici = new Kullanici { Id = yeniId, Adi = model.Adi, Soyadi = model.Soyadi, KulAdi = model.KulAdi, KulSifre = model.KulSifre, Aktif = model.Aktif, Seviye = model.Seviye, DokumAlabilsin = model.DokumAlabilsin, AdSoyadSorgulasin = model.AdSoyadSorgulasin, Ekleyen = "", EklemeTar = DateTime.Now //TCSorgulasin = model.TCSorgulasin }; Dbc.Kullanici.Add(kullanici); Dbc.SaveChanges(); return(model); }
public Operation(TKey id, Verb verb, object datum) { Dbc.Requires(datum != null); Id = id; Verb = verb; Datum = datum; }
public ArtistStore( [FromServices] Dbc dbc, [FromServices] Library library ) : base(dbc) { this._library = library; }
public GenreAlbumStore( [FromServices] Dbc dbc, [FromServices] Library library ) : base(dbc) { this._library = library; }
public PageResult <GlobalsettingDto> QueryGlobalsettingList(int pageIndex = 1, int pageSize = 10, string sort = null, string order = null) { IQuery <GlobalsettingDto> query = Dbc.GetIQuery <GlobalsettingDto>(Request.Form) .AutoOrderBy(sort, order, a => a.Id, Sorting.Asc) .Page(pageIndex, pageSize); return(query.ToPageList()); }
public TrackStore( [FromServices] Dbc dbc, [FromServices] Tracklist tracklist, [FromServices] Playback playback ) : base(dbc) { this._tracklist = tracklist; this._playback = playback; }
public AlbumStore( [FromServices] Dbc dbc, [FromServices] Library library, [FromServices] TrackStore trackStore ) : base(dbc) { this._library = library; this._trackStore = trackStore; }
public Kayitlar Cikar(int?id) { Kayitlar kayit = Dbc.Kayitlar.Find(id); kayit.KaraListe = false; Dbc.Entry(kayit).State = System.Data.Entity.EntityState.Modified; Dbc.SaveChanges(); return(kayit); }
public static void StartNewLine(Context context, int deltaIndentCount = 0) { var newIndentCount = context.IndentCount + deltaIndentCount; Dbc.Precondition(newIndentCount >= 0); context.IndentCount = newIndentCount; Write(context, '\n'); WriteIndentation(context); }
protected bool IsDisposed = false; // 重複する呼び出しを検出するには protected virtual void Dispose(bool disposing) { if (!this.IsDisposed) { if (disposing) { this.Dbc = null; } this.IsDisposed = true; } }
public async Task <IEntity[]> Scan(Dbc dbc) { this._processLength = 0; this._processed = 0; // アルバム取得 var allRefs = await this._library.Browse(AlbumStore.AlbumQueryString); var existsUris = dbc.Albums.Select(e => e.Uri).ToArray(); var newRefs = allRefs.Where(e => !existsUris.Contains(e.Uri)).ToArray(); var newEntityDictionary = newRefs.Select(e => new Album() { Name = e.Name, LowerName = e.Name.ToLower(), Uri = e.Uri }).ToDictionary(e => e.Uri); this._processLength = newEntityDictionary.Count(); // 年度別アルバムを取得して割り当て var yearResults = await this._library.Browse(AlbumStore.YearQueryString); foreach (var row in yearResults) { if (!int.TryParse(row.Name, out var year)) { continue; } var yearAlbums = await this._library.Browse(row.Uri); foreach (var ya in yearAlbums) { var albumUri = ya.GetAlbumUri(); if (newEntityDictionary.ContainsKey(albumUri)) { newEntityDictionary[albumUri].Year = year; this._processed++; } } } var newEntities = newEntityDictionary.Select(e => e.Value).ToArray(); if (0 < newEntities.Length) { dbc.Albums.AddRange(newEntities); } return(newEntities); }
public AlbumTracksStore( [FromServices] Dbc dbc, [FromServices] Library library, [FromServices] Playback playback, [FromServices] TrackStore trackStore, [FromServices] AlbumStore albumStore ) : base(dbc) { this._library = library; this._playback = playback; this._trackStore = trackStore; this._albumStore = albumStore; }
public async Task <IEntity[]> Scan(Dbc dbc) { this._processLength = 0; this._processed = 0; var newEntities = dbc.GenreAlbums .Join( dbc.ArtistAlbums, ga => ga.AlbumId, aa => aa.AlbumId, (ga, aa) => new { ga.GenreId, aa.ArtistId } ) .GroupBy(e => new { e.GenreId, e.ArtistId }) .Select(e => new GenreArtist() { GenreId = e.Key.GenreId, ArtistId = e.Key.ArtistId }) .ToArray() .GroupJoin( dbc.GenreArtists, found => new { found.GenreId, found.ArtistId }, exists => new { exists.GenreId, exists.ArtistId }, (found, exists) => new { found, exists } ) .Where(e => !e.exists.Any()) .Select(e => e.found) .ToArray(); this._processLength = newEntities.Length; this._processed = this._processLength; if (0 < newEntities.Length) { dbc.GenreArtists.AddRange(newEntities); } return(newEntities); }
public bool Sil(int?id) { try { Dbc.Kullanici.Remove(Dbc.Kullanici.Find(id)); Dbc.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public void LogCikis(int userId) { Kullanici kullanici = Dbc.Kullanici.First(k => k.Id == userId); // Log Çıkış int yeniId = Dbc.LogGirisCikis.DefaultIfEmpty().Max(t => t == null ? 0 : t.Id + 1); Dbc.LogGirisCikis.Add(new LogGirisCikis() { Id = yeniId, KulaniciId = kullanici.Id, CikisTar = DateTime.Now, KullaniciAdi = kullanici.KulAdi }); Dbc.SaveChanges(); }
public async Task <IEntity[]> Scan(Dbc dbc) { this._processLength = 0; this._processed = 0; var genres = dbc.Genres.ToArray(); var albums = dbc.Albums.ToArray(); var genreAlbums = dbc.GenreAlbums.ToArray(); var newEntities = new List <GenreAlbum>(); this._processLength = genres.Length; foreach (var genre in genres) { var refs = await this._library.Browse(genre.Uri); var albumUris = refs.Select(e => e.GetAlbumUri()).ToArray(); var albumIds = albums .Where(e => albumUris.Contains(e.Uri)) .Select(e => e.Id) .ToArray(); var exists = genreAlbums .Where(e => albumIds.Contains(e.AlbumId) && e.GenreId == genre.Id) .ToArray(); foreach (var albumId in albumIds) { if (exists.All(e => e.AlbumId != albumId)) { newEntities.Add(new GenreAlbum() { GenreId = genre.Id, AlbumId = albumId }); } } this._processed++; } if (0 < newEntities.Count()) { dbc.GenreAlbums.AddRange(newEntities); } return(newEntities.ToArray()); }
public List <Mahalle> JSonMahalleler(string SehirAdi, string ilceAdi) { List <Mahalle> liste = new List <Mahalle> { new Mahalle() { Adi = " " } }; List <string> mahalleler = Dbc.prMahalle(SehirAdi, ilceAdi).ToList(); foreach (string mah in mahalleler) { liste.Add(new Mahalle() { Adi = mah }); } return(liste); }
protected void Button1_Click(object sender, EventArgs e) { if (TextBox1.Text == "" || TextBox2.Text == "") { ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "updateScript", "alert('Email and password can not be empty.')", true); return; } String password=TextBox2.Text; Dbc dbc = new Dbc(); Table_Customer customer = dbc.GetCustomer(TextBox1.Text); if (customer != null) { if (customer.Password.Equals(password)) { Panel1.Visible = false; Session["Customer"] = customer.EmailAddress; } } else ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "updateScript", "alert('Incorrect email or password.')", true); }
public Kullanici Duzenle(Kullanici model) { Kullanici kullanici = Dbc.Kullanici.Find(model.Id); string userId = Convert.ToString(HttpContext.Current.Session["UserId"]); kullanici.Adi = model.Adi; kullanici.Soyadi = model.Soyadi; kullanici.KulAdi = model.KulAdi; kullanici.KulSifre = model.KulSifre; kullanici.Aktif = model.Aktif; kullanici.Seviye = model.Seviye; kullanici.DokumAlabilsin = model.DokumAlabilsin; kullanici.AdSoyadSorgulasin = model.AdSoyadSorgulasin; kullanici.Duzenleyen = userId; kullanici.DuzenlemeTar = DateTime.Now; Dbc.Entry(kullanici).State = System.Data.Entity.EntityState.Modified; Dbc.SaveChanges(); return(model); }
public List <Ilce> JSonIlceler(string sehirAdi) { List <Ilce> liste = new List <Ilce> { new Ilce() { Adi = " " } }; List <string> ilceler = Dbc.prIlce(sehirAdi).ToList(); foreach (string ilce in ilceler) { liste.Add(new Ilce() { Adi = ilce }); } //foreach (var item in Dbc.Ilceler.Where(i => i.sehirId == sehirId).ToList()) //{ // liste.Add(new Ilce() { Id = item.ilceId, Adi = item.ilceAdi }); //} return(liste); }
public GenreArtistStore([FromServices] Dbc dbc) : base(dbc) { }
protected PagenagedStoreBase(Dbc dbc) : base(dbc) { }
public WebSocketStore([FromServices] Dbc dbc) : base(dbc) { this.Connect(); }
protected StoreBase(Dbc dbc) { this.Dbc = dbc; }
public void WhenOneOfMultipleValuesIsNull() { Giv.n(() => Values("", 1, null)); Th.n(() => Assert.Throws <DbcException>(() => Dbc.NotNull(_vls, "message"))); }
public XhrResponse Exists([FromServices] Dbc dbc) { var result = dbc.Albums.Any(); return(XhrResponseFactory.CreateSucceeded(result)); }
public SettingsStore([FromServices] Dbc dbc) : base(dbc) { }
public JobStore([FromServices] Dbc dbc) : base(dbc) { }
public void WhenAValueIsNull() { Giv.n(() => AValue(null)); Th.n(() => Assert.Throws <DbcException>(() => Dbc.NotNull(_value))); }