public InforService(Servicer s) { managerHotel = new ConnectDatabaseDataContext(); service = s; InitializeComponent(); showServiceToUpdate(); }
public static ServicerResult ToResult(Servicer servicer) { return(new ServicerResult { Identification = servicer.Identification, SchemeName = servicer.SchemeName?.Name }); }
void Awake() { Instance = this; if (Instance != this) { return; } }
string GetCurency(string url) { string cur = null; Servicer servicer = new Servicer(); XmlDocument doc = servicer.GetXmlCurencyData(url); XmlParser parser = new XmlParser(); if (doc != null) { cur = parser.GetCurrency(doc); } return(cur); }
public void AddProductInspectTest() { for (int i = 0; i < 100; i++) { Dictionary <string, string> data = new Dictionary <string, string>(); data.Add("entityId", "RBA4"); data.Add("inspectTime", TimeUtil.GetMilliseconds(DateTime.Now).ToString()); data.Add("productNr", Guid.NewGuid().ToString()); data.Add("partId", "91G9067"); data.Add("type", (i % 2).ToString()); LogUtil.Logger.Error(data); Servicer service = new Servicer(); service.AddProductInspect(data); Thread.Sleep(2000); } }
public void AddProductPackTest() { try { Dictionary <string, string> data = new Dictionary <string, string>(); data.Add("entityId", "RBA4"); data.Add("packTime", Brilliantech.BaseClassLib.Util.TimeUtil.GetMilliseconds(DateTime.Now).ToString()); data.Add("productNr", Guid.NewGuid().ToString()); data.Add("partId", "91G9067"); Brilliantech.BaseClassLib.Util.LogUtil.Logger.Error(data); Servicer service = new Servicer(); service.AddProductPack(data); } catch (Exception e) { LogUtil.Logger.Error(e.Message); } }
//tạo mới private void CreateSer_Click(object sender, EventArgs e) { Servicer s = new Servicer(); s.name = NameSer.Text; s.price = Convert.ToDouble(PriceSer.Text); s.sale = (double)SaleSer.Value; s.descript = DescriptSer.Text; //s.date_created = Convert.ToDateTime(date.ToString(format)); s.date_created = dateTimeNow; managerHotel.Servicers.InsertOnSubmit(s); managerHotel.SubmitChanges(); MessageBox.Show("Thêm mới thành công !"); this.DialogResult = DialogResult.OK; this.Close(); }
private void Process(string fullPath) { try { bool ok = false; if (FileUtil.IsFileClosed(fullPath)) { using (FileStream fs = File.Open(fullPath, FileMode.Open, FileAccess.Read)) { using (StreamReader reader = new StreamReader(fs)) { while (reader.Peek() >= 0) { string s = reader.ReadLine(); if (s == null || s.Length == 0 || s.Split(Conf.DataSpliter).Length != Conf.PackParamCount) { ok = true; LogUtil.Logger.Error("【数据错误】【文件】" + Path.GetFileName(fullPath)); // File.Delete(fullPath); } else { string[] data = s.Split(Conf.DataSpliter); Dictionary <string, string> dataMap = new Dictionary <string, string>(); dataMap.Add("partId", data[0]); dataMap.Add("productNr", data[1]); dataMap.Add("entityId", data[2]); dataMap.Add("packTime", data[3]); ok = new Servicer().AddProductPack(dataMap); } } } } } if (ok) { File.Delete(fullPath); } } catch (Exception e) { LogUtil.Logger.Error(e.Message); } }
private void Process(string fullPath) { try { bool ok = false; using (FileStream fs = File.Open(fullPath, FileMode.Open, FileAccess.Read)) { using (StreamReader reader = new StreamReader(fs)) { string s = reader.ReadLine(); if (s == null || s.Length == 0 || s.Split(Conf.DataSpliter).Length != Conf.TestParamCount) { ok = true; LogUtil.Logger.Error("【数据错误】【文件】" + Path.GetFileName(fullPath)); //File.Delete(fullPath); } else { string[] data = s.Split(Conf.DataSpliter); Dictionary <string, string> dataMap = new Dictionary <string, string>(); dataMap.Add("entityId", data[0]); DateTime date = DateTime.Now; DateTime.TryParse(data[1], out date); dataMap.Add("inspectTime", TimeUtil.GetMilliseconds(date).ToString()); dataMap.Add("partNr", data[2]); dataMap.Add("productNr", data[3]); dataMap.Add("type", data[4]); ok = new Servicer().AddProductInspect(dataMap); } } } if (ok) { File.Delete(fullPath); } } catch (Exception e) { LogUtil.Logger.Error(e.Message); } }
public void packTest(object o) { for (int i = 0; i < 200; i++) { try { Dictionary <string, string> data = new Dictionary <string, string>(); data.Add("entityId", ""); data.Add("packTime", TimeUtil.GetMilliseconds(DateTime.Now).ToString()); data.Add("productNr", Guid.NewGuid().ToString()); data.Add("partId", "91G104803"); LogUtil.Logger.Error(data); Servicer service = new Servicer(); service.AddProductPack(data); } catch (Exception e) { LogUtil.Logger.Error(e.Message); } } }
private void dataServices_CellClick(object sender, DataGridViewCellEventArgs e) { if (dataServices.CurrentRow != null) { int idService = Convert.ToInt32(dataServices.CurrentRow.Cells["IdSer"].Value.ToString()); seviceSelected = managerHotel.Servicers.FirstOrDefault(x => x.id == idService); //hiển thị nút UpdateService.Visible = true; ChangeSttService.Visible = true; if (seviceSelected.stt == 1) { ChangeSttService.Image = Image.FromFile(Path.Combine(Application.StartupPath, @"..\..\Commons\icons\icons8_eye_32.png")); ChangeSttService.Text = "Dịch vụ có thể dùng"; } else if (seviceSelected.stt == 0) { ChangeSttService.Image = Image.FromFile(Path.Combine(Application.StartupPath, @"..\..\Commons\icons\icons8_invisible_32.png")); ChangeSttService.Text = "Dịch vụ không thể dùng"; } } }
public void packTest(object o) { for (int i = 0; i < 100; i++) { Console.WriteLine("{0}--{1}",o,i); try { Dictionary<string, string> data = new Dictionary<string, string>(); data.Add("entityId", ""); data.Add("packTime", TimeUtil.GetMilliseconds(DateTime.Now).ToString()); data.Add("productNr", Guid.NewGuid().ToString()); data.Add("partId", "91G104803"); LogUtil.Logger.Error(data); Servicer service = new Servicer(); service.AddProductPack(data); } catch (Exception e) { LogUtil.Logger.Error(e.Message); //Brilliantech.Packaging.EpmIntegration.Util.LogUtil.Logger.Error(e.Message); } } }