public void AcceptedBasket() { ExceptionCatcher.ExceptionFinder(() => { if (combobox_musteri.SelectedItem == null) { MessageBox.Show("Müşteri Seçiniz!"); } else { using (SDB sdb = new SDB()) { for (int i = 0; i < SepetHelper.Sepet.Count; i++) { Sati sati = new Sati(); sati.SatisUrunID = SepetHelper.Sepet[i].UrunID; sati.SatisTarih = DateTime.Now; sati.SatisAdet = SepetHelper.Sepet[i].urunAdet; sati.SatisFiyat = Convert.ToDecimal(SepetHelper.Sepet[i].urunToplamFiyat); sati.SatisPerID = AuthenticateHelperr.LoginUser[0].PersonelID; sati.SatisMusID = Convert.ToInt32(combobox_musteri.EditValue); DAL.DAL dal = new DAL.DAL(); dal.SatisRapor(sati); } MainWindow window = (MainWindow)Window.GetWindow(this); MessageBox.Show("Satış Yapıldı"); window.TabControlMain.SelectedContainer.Close(); window.AcceptBasket.IsEnabled = false; window.CancelBasket.IsEnabled = false; SepetHelper.Sepet = null; } } }); }
public static int Execute(List <string> args) { if (args.Count != 3) { Console.WriteLine("Usage: XilliaScript_GraceNote XilliaScriptFile NewDBFile GracesJapanese"); return(-1); } String Filename = args[0]; String NewDB = args[1]; String GracesDB = args[2]; SDB XSF = new SDB(Filename); GraceNoteUtil.GenerateEmptyDatabase(NewDB); if (!System.IO.File.Exists(GracesDB)) { GraceNoteUtil.GenerateEmptyGracesJapanese(GracesDB); } List <GraceNoteDatabaseEntry> Entries = new List <GraceNoteDatabaseEntry>(XSF.TextList.Count); foreach (SDBEntry entry in XSF.TextList) { GraceNoteDatabaseEntry gn = new GraceNoteDatabaseEntry(entry.Text, entry.Text, "", 0, (int)entry.PointerText, entry.IDString, (int)entry.PointerIDString); Entries.Add(gn); } GraceNoteDatabaseEntry.InsertSQL(Entries.ToArray(), "Data Source=" + NewDB, "Data Source=" + GracesDB); return(0); }
public void DeleteItem() { ExceptionCatcher.ExceptionFinder(() => { using (SDB sdb = new SDB()) { var personel = new Personel { PersonelID = personelEntity.PersonelID }; DAL.DAL dal = new DAL.DAL(); MessageBoxResult result = DXMessageBox.Show("Çalışan Silinecek Onaylıyor Musunuz?", "Uyarı", MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.Yes, MessageBoxOptions.None); switch (result) { case MessageBoxResult.Yes: dal.DeleteRecordPer(personel); MessageBox.Show("Personel Silindi!"); gridcontrol_personel.ItemsSource = null; GetPersonelList(); break; case MessageBoxResult.No: break; } } }); }
public void DeleteItem() { ExceptionCatcher.ExceptionFinder(() => { using (SDB sdb = new SDB()) { var urun = new Urun { UrunID = Urunentity.UrunID }; DAL.DAL dal = new DAL.DAL(); MessageBoxResult result = DXMessageBox.Show("Ürünü Silinecek Onaylıyor Musunuz?", "Uyarı", MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.Yes, MessageBoxOptions.None); switch (result) { case MessageBoxResult.Yes: dal.DeleteRecord(urun); MessageBox.Show("Ürün Silindi!"); GridControl_ProductList.ItemsSource = null; GetUrunList(); break; case MessageBoxResult.No: break; } } }); }
/// <summary> /// 验证用户是否具有该方法的权限 /// </summary> public static string ValidateUserAuthentication(string userToken) { if (_allMethodFunctionList == null || _allMethodFunctionList.Count == 0) { //改为现在查询 old // var userManager = new UserManager(); //new // var userManager = new UserManager(); // _allMethodFunctionList = userManager.LoadAllMethodFunction(); _allMethodFunctionList = SDB.CreateQuery <MethodFunction>().ToList(); } var method = new System.Diagnostics.StackFrame(1).GetMethod(); var currentFullName = string.Format("{0}.{1}", method.ReflectedType.FullName, method.Name); var config = _allMethodFunctionList.FirstOrDefault(p => p.MethodFullName == currentFullName); if (config == null) { throw new Exception(string.Format("没有配置方法 {0} 的调用权限数据", currentFullName)); } var userId = string.Empty; ValidateAuthentication(userToken, config.Mode, config.FunctionId, out userId); return(userId); }
// Convert interval of DB to struct _SDB private SDB[] DB_2_Struct(int from, int to, ref Dictionary <int, List <int> > cdb) { SDB[] sdb = new SDB[MAX_Send]; var keys = cdb.Select(z => z.Key).ToArray(); var values = cdb.Select(z => z.Value).ToArray(); for (int i = from; i < to; i++) { sdb[i % MAX_Send].key = keys[i]; sdb[i % MAX_Send].lengthVal = values[i].Count; //* int x = MAX_Friends_for_1_user - values[i].Count; for (int j = 0; j < x; j++) { values[i].Add(-1); } //*/ sdb[i % MAX_Send].value = values[i].ToArray(); } for (int j = sdb.Length; j < MAX_Send; j++) { sdb[j].key = -1; sdb[j].lengthVal = -1; sdb[j].value[0] = -1; } return(sdb); }
public (double distance, Shape shape) March(Ray ray) { (var t, var dt) = (0.0, 0.0); Shape shape = null; for (int i = 0; i < MaxRaySteps; i++) { var p = ray.GetPoint(t); dt = SDB.Distance(p); if (dt < SDB.PixelSize) { (dt, shape) = Scene.Distance(p); } if (dt < MinMarchDistance) { break; } t += dt; if (t > MaxMarchDistance) { break; } } if (shape == null && t < MaxMarchDistance) { var p = ray.GetPoint(t); (dt, shape) = Scene.Distance(p); } return(t, shape); }
public void DeleteItem() { ExceptionCatcher.ExceptionFinder(() => { using (SDB sdb = new SDB()) { var customer = new Musteri { MusteriID = musteri.MusteriID }; DAL.DAL dal = new DAL.DAL(); MessageBoxResult result = DXMessageBox.Show("Çalışan Silinecek Onaylıyor Musunuz?", "Uyarı", MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.Yes, MessageBoxOptions.None); switch (result) { case MessageBoxResult.Yes: dal.DeleteRecordMus(customer); MessageBox.Show("Ürün Silindi!"); gridControl_customerList.ItemsSource = null; GetMusteriList(); break; case MessageBoxResult.No: break; } } }); }
private void login_btn_Click(object sender, RoutedEventArgs e) { model.PersonelUsername = LoginUsername.Text; model.PersonelPassword = LoginPassword.Password; using (SDB sdbContext = new SDB()) { foreach (var person in sdbContext.Personels) { if (person.PersonelUsername.Trim() == LoginUsername.Text && person.PersonelPassword.Trim() == LoginPassword.Password) { Mainpage mainpage = new Mainpage(); mainpage.Show(); this.Close(); // MessageBox.Show("Kullanıcı Girişi Başarılı"); } else { // MessageBox.Show("Başarısız!"); } } } }
/// <summary> /// 查询彩种 /// </summary> public static LotteryGame QueryLotteryGame(string gameCode) { if (_cacheAllGameList == null || _cacheAllGameList.Count <= 0) { //var manager = new LotteryGameManager(); var p = SDB.CreateQuery <LotteryGame>().ToList(); _cacheAllGameList.AddRange(p); } return(_cacheAllGameList.FirstOrDefault(p => p.GameCode == gameCode)); }
private SDB ReadStringDatabase(string name) { byte[] sdbFile = File.ReadAllBytes(Path.Combine(FolderName, name)); SpanReader sr = new SpanReader(sdbFile); sr.Position = 0x08; Endian endian = sr.ReadInt16() == 1 ? Endian.Little : Endian.Big; SDB sdb = new SDB(sdbFile, endian); return(sdb); }
private static void Convert_SDB_TO_PNG(string path) { Console.Write(path + ".."); var sdb = new SDB(path); var lines = sdb.items.Select(x => x.id + "---" + x.value).ToArray(); var endPath = ReplaceExtension(path, ".sdb.txt"); File.WriteAllLines(endPath, lines); Console.WriteLine("Ok"); }
private void FillCategoryList() { ExceptionCatcher.ExceptionFinder(() => { using (SDB sdb = new SDB()) { productCat_combobox.Items.Clear(); var kategoriList = sdb.Kategoris.ToList(); productCat_combobox.ItemsSource = kategoriList; } }); }
//SAVE İşlemini Yapıyor public void AddNewItem() { ExceptionCatcher.ExceptionFinder(() => { using (SDB sdbContext = new SDB()) { if (Urunentity == null) { Urun urun = new Urun(); urun.UrunAd = productName.Text; urun.UrunFiyat = Convert.ToDecimal(productPrice.Text); urun.UrunKod = productCode.Text; urun.UrunStok = Convert.ToInt16(txtedit_productStok.Text); urun.UrunKatID = ((Kategori)productCat_combobox.SelectedItem).KategoriID; urun.UrunPic = BL.ImageHelper.ConvertImageToByte(Pro_pic_url.Text); pro_image.Source = new BitmapImage(new Uri(Pro_pic_url.Text)); DAL.DAL dal = new DAL.DAL(); dal.NewRecord(urun); FormContainer.Visibility = Visibility.Collapsed; GridControl_ProductList.ItemsSource = null; GetUrunList(); } else { Urun urun = new Urun(); urun.UrunID = Urunentity.UrunID; urun.UrunAd = productName.Text; urun.UrunFiyat = Convert.ToDecimal(productPrice.Text); urun.UrunKod = productCode.Text; urun.UrunStok = Convert.ToInt16(txtedit_productStok.Text); if (Urunentity.UrunPic != null) { urun.UrunPic = Urunentity.UrunPic; } urun.UrunKatID = ((Kategori)productCat_combobox.SelectedItem).KategoriID; DAL.DAL dal = new DAL.DAL(); dal.UpdateRecord(urun); MainWindow window = (MainWindow)Window.GetWindow(this); window.RibbonController(); FormContainer.Visibility = Visibility.Collapsed; GridControl_ProductList.ItemsSource = null; GetUrunList(); ClearForm(); } } }); }
public void AddNewItem() { ExceptionCatcher.ExceptionFinder(() => { using (SDB sdbContext = new SDB()) { if (personelEntity == null) { Personel personel = new Personel(); personel.PersonelAd = personalName.Text; personel.PersonelSoyad = personelLastname.Text; personel.PersonelRoleID = chkboxAdmin.IsChecked.Value == true ? int.Parse(chkboxAdmin.Tag.ToString()) : chkboxUser.IsChecked.Value == true ? int.Parse(chkboxUser.Tag.ToString()) : int.Parse(chkboxUser2.Tag.ToString()); personel.PersonelUsername = personelUsername.Text; personel.PersonelPassword = HashingHelper.HashingPassword(personelPassword.Text); personel.PersonelPic = ImageHelper.ConvertImageToByte(Per_pic_url.Text); DAL.DAL dal = new DAL.DAL(); dal.NewRecordPer(personel); gridPersonelForm.Visibility = Visibility.Collapsed; gridcontrol_personel.ItemsSource = null; GetPersonelList(); } else { Personel personel = new Personel(); personel.PersonelID = personelEntity.PersonelID; personel.PersonelAd = personalName.Text; personel.PersonelSoyad = personelLastname.Text; personel.PersonelRoleID = chkboxAdmin.IsChecked.Value == true ? int.Parse(chkboxAdmin.Tag.ToString()) : chkboxUser.IsChecked.Value == true ? int.Parse(chkboxUser.Tag.ToString()) : int.Parse(chkboxUser2.Tag.ToString()); personel.PersonelUsername = personelUsername.Text; personel.PersonelPassword = HashingHelper.HashingPassword(personelPassword.Text); if (personelEntity.PersonelPic != null) { personel.PersonelPic = personelEntity.PersonelPic; } DAL.DAL dal = new DAL.DAL(); dal.UpdateRecordPer(personel); MainWindow window = (MainWindow)Window.GetWindow(this); window.RibbonController(); gridPersonelForm.Visibility = Visibility.Collapsed; gridcontrol_personel.ItemsSource = null; GetPersonelList(); ClearForm(); } } }); }
private void FillCustomerList() { ExceptionCatcher.ExceptionFinder(() => { using (SDB sdb = new SDB()) { DAL.DAL dal = new DAL.DAL(); combobox_musteri.Items.Clear(); var query = (from m in sdb.Musteris select new { musteriId = m.MusteriID, musteriAdSoyad = m.MusteriAdi + " " + m.MusteriSoyadi, }).ToList(); combobox_musteri.ItemsSource = query; } }); }
public void AddNewItem() { ExceptionCatcher.ExceptionFinder(() => { using (SDB sdbContext = new SDB()) { if (musteri == null) { Musteri musteri = new Musteri(); musteri.MusteriAdi = customerName.Text; musteri.MusteriSoyadi = customerLastname.Text; musteri.MusteriAdres = customerAddress.Text; musteri.MusteriTelNo = customerTelNo.Text; DAL.DAL dal = new DAL.DAL(); dal.NewRecordMus(musteri); grid_customerForm.Visibility = Visibility.Collapsed; gridControl_customerList.ItemsSource = null; GetMusteriList(); } else { Musteri cust = new Musteri(); cust.MusteriID = musteri.MusteriID; cust.MusteriAdi = customerName.Text; cust.MusteriSoyadi = customerLastname.Text; cust.MusteriAdres = customerAddress.Text; cust.MusteriTelNo = customerTelNo.Text; DAL.DAL dal = new DAL.DAL(); dal.UpdateRecordMus(cust); MainWindow window = (MainWindow)Window.GetWindow(this); window.RibbonController(); grid_customerForm.Visibility = Visibility.Collapsed; gridControl_customerList.ItemsSource = null; GetMusteriList(); ClearForm(); } } }); }
private void btn_login_Click(object sender, RoutedEventArgs e) { ExceptionCatcher.ExceptionFinder(() => { if (txtedit_username.Text.Length == 0 || txtbox_password.Text.Length == 0) { MessageBox.Show("Lütfen Kullanıcı Adı ve Şifre Giriniz!"); } else { using (SDB sdb = new SDB()) { var hashpassword = HashingHelper.HashingPassword(txtbox_password.Text); Personel personel = (from p in sdb.Personels where p.PersonelUsername == txtedit_username.Text && p.PersonelPassword == hashpassword select p).Single(); if (personel != null) { BL.AuthenticateHelperr.LoginUser.Add(personel); AuthenticateHelperr.LoginUser.Add(new Personel { PersonelID = personel.PersonelID, PersonelAd = personel.PersonelAd, PersonelSoyad = personel.PersonelSoyad, PersonelRoleID = personel.PersonelRoleID }); NLogger.GetLogItems(null, InfoLogTypes.LoginLogout, DateTime.UtcNow, UserAuthenticationStatus.Login, $"{personel.PersonelAd} {personel.PersonelSoyad}"); MainWindow mainWindow = new MainWindow(); this.Close(); mainWindow.Show(); } else { MessageBox.Show("KullanıcıAdı veya Şifre Hatalı!"); } } } }); }
/// <summary> /// The role of IComparable is to provide a method of comparing two objects of a particular type. This is necessary if you want to provide any ordering capability for your object. /// </summary> public int CompareTo(object obj) { IshTypeFieldDefinition b = (IshTypeFieldDefinition)obj; if (!Key.Equals(b.Key, StringComparison.InvariantCulture)) { return(string.Compare(Key, b.Key)); } // Keys match, now check the properties that matter if (!Type.Equals(b.Type, StringComparison.InvariantCulture)) { _logger.WriteVerbose($"IshTypeFieldDefinition.CompareTo a.Key[{Key}] a.Type[{Type}] b.Type[{b.Type}]"); return(string.Compare(Type, b.Type)); } if (!MM.Equals(b.MM, StringComparison.InvariantCulture)) { _logger.WriteVerbose($"IshTypeFieldDefinition.CompareTo a.Key[{Key}] a.MM[{MM}] b.MM[{b.MM}]"); return(string.Compare(MM, b.MM, StringComparison.InvariantCulture)); } if (!CRUS.Equals(b.CRUS, StringComparison.InvariantCulture)) { _logger.WriteVerbose($"IshTypeFieldDefinition.CompareTo a.Key[{Key}] a.CRUS[{CRUS}] b.CRUS[{b.CRUS}]"); return(string.Compare(CRUS, b.CRUS, StringComparison.InvariantCulture)); } if (!SDB.Equals(b.SDB, StringComparison.InvariantCulture)) { _logger.WriteVerbose($"IshTypeFieldDefinition.CompareTo a.Key[{Key}] a.SDB[{SDB}] b.SDB[{b.SDB}]"); return(string.Compare(SDB, b.SDB, StringComparison.InvariantCulture)); } if (!Description.Equals(b.Description, StringComparison.InvariantCulture)) { _logger.WriteDebug($"IshTypeFieldDefinition.CompareTo a.Key[{Key}] a.Description[{Description}] b.Description[{b.Description}]"); return(0); // Difference in description is nice-to-know but considered equal } return(0); }