private void button8_Click(object sender, EventArgs e) { using (OpenFileDialog openFileDialog = new OpenFileDialog()) { if (openFileDialog.ShowDialog() == DialogResult.OK) { string filePath = openFileDialog.FileName; if (filePath.Equals(null) || filePath.Equals("")) { return; } string time = string.Format("{0:00}", Hourse.Value) + ":" + string.Format("{0:00}", Minutes.Value); string date = DateTime.Now.ToString("MM/dd/yyyy"); DataBaseMethods.AddNote("Schedule", "'PATH','TIME','DATE'", $"'{filePath}','{time}','{date}'"); FormElementsToScheduleScan tempPanel = new FormElementsToScheduleScan(flowLayoutPaneltoSScan); tempPanel.DateToToScheduleScan.Text = date; tempPanel.TimeToScheduleScan.Text = time; tempPanel.TextBoxToScheduleScan.Text = filePath; lformElementsShedules.Add(tempPanel); } } }
private void DirButtonMonitoring_Click(object sender, EventArgs e) { using (var fbd = new FolderBrowserDialog()) { DialogResult result = fbd.ShowDialog(); if (result == DialogResult.OK && !string.IsNullOrWhiteSpace(fbd.SelectedPath)) { string[] files = Directory.GetFiles(fbd.SelectedPath); string date = DateTime.Now.ToString("MM/dd/yyyy"); string time = DateTime.Now.ToString("H:mm"); DataBaseMethods.AddNote("Monitoring", "'PATH','DATE','TIME'", $"'{fbd.SelectedPath}','{date}','{time}'"); var panelTemp = new FormElementsMonitoring(flowLayoutPanelMonitor); panelTemp.textBoxMonitor.Text = fbd.SelectedPath; panelTemp.DataMonitorLabel.Text = date; panelTemp.TimeMonitorLabel.Text = time; panelTemp.DeafultMonitoringAction(); lformElementsMonitorings.Add(panelTemp); } } }
private static void SetCupboardAnglesComponents(string value, MySqlConnection conn) { var reader = DataBaseMethods.SqlSearch("Piece", "Ref", "'" + value + "'", conn); while (reader.Read()) { Kitbox.Models.Database.Components.CupboardAngles.AddCupboardAngle(reader.GetString("Couleur"), reader.GetInt32("hauteur"), 0, 0, reader.GetInt32("Enstock"), reader.GetInt32("Stock minimum"), reader.GetString("Code"), reader.GetString("Dimensions(cm)")); } reader.Close(); }
private static void SetPanelComponents(string value, MySqlConnection conn) { var reader = DataBaseMethods.SqlSearch("Piece", "Ref", "'" + value + "'", conn); while (reader.Read()) { Kitbox.Models.Database.Components.Panels.AddPanel(reader.GetString("Couleur"), value.Replace("Panneau ", ""), reader.GetInt32("hauteur"), reader.GetInt32("largeur"), reader.GetInt32("profondeur"), reader.GetInt32("Enstock"), reader.GetInt32("Stock minimum"), reader.GetString("Code"), reader.GetString("Dimensions(cm)")); } reader.Close(); }
protected void Initialize() { driver = new ChromeDriver(); driver.Manage().Window.Maximize(); driver.Url = "http://fortesting.info/"; logInPage = new LoginPage(driver); commonMethods = new CommonMethods(driver); accessPage = new AccessPage(driver); homePage = new HomePage(driver); dataBaseMethods = new DataBaseMethods(); accessPage.AcseesToWebSite(); LogUtil.WriteDebug("Opened Chrome browser"); LogUtil.WriteDebug("Navigating to http://fortesting.info/"); LogUtil.WriteDebug("**********Starting execution a new test**********"); }
private void button7_Click(object sender, EventArgs e) { operationDone = false; using (var fbd = new FolderBrowserDialog()) { DialogResult result = fbd.ShowDialog(); if (result == DialogResult.OK && !string.IsNullOrWhiteSpace(fbd.SelectedPath)) { string time = string.Format("{0:00}", Hourse.Value) + ":" + string.Format("{0:00}", Minutes.Value); string date = DateTime.Now.ToString("MM/dd/yyyy"); DataBaseMethods.AddNote("Schedule", "'PATH','TIME','DATE'", $"'{fbd.SelectedPath}','{time}','{date}'"); FormElementsToScheduleScan tempPanel = new FormElementsToScheduleScan(flowLayoutPaneltoSScan); tempPanel.DateToToScheduleScan.Text = date; tempPanel.TimeToScheduleScan.Text = time; tempPanel.TextBoxToScheduleScan.Text = fbd.SelectedPath; lformElementsShedules.Add(tempPanel); } } }
public void GivenConnectionToShopDatabaseIsEstablished() { dbMethods = new DataBaseMethods(); dbMethods.ConnectToCatalog("PersonsOrders"); }
public static Dictionary <string, Dictionary <string, object> > SearchComponent(int uid, string width, string depth, string height, string colorDoor, string colorPanel, Cupboard cupboard, Order.Order order, MySqlConnection conn) { Dictionary <string, Dictionary <string, object> > componentDict = new Dictionary <string, Dictionary <string, object> >(); conn.Open(); var panelBack = DataBaseMethods.SqlSearchComponent("Piece", "largeur", "hauteur", "Couleur", "Ref", width, height, colorPanel, "Panneau Ar", conn); componentDict.Add("PanelBack", ReaderData(order, panelBack, typeof(Panel))); var panelSides = DataBaseMethods.SqlSearchComponent("Piece", "profondeur", "hauteur", "Couleur", "Ref", depth, height, colorPanel, "Panneau GD", conn); componentDict.Add("PanelSides", ReaderData(order, panelSides, typeof(Panel))); var panelHB = DataBaseMethods.SqlSearchComponent("Piece", "largeur", "profondeur", "Couleur", "Ref", width, depth, colorPanel, "Panneau HB", conn); componentDict.Add("PanelHB", ReaderData(order, panelHB, typeof(Panel))); if (colorDoor != "I don't want a door") { string size; if (width == "62") { size = ((Int32.Parse(width) + 2) / 2).ToString(); } else { size = (Int32.Parse(width) / 2 + 2).ToString(); } var door = DataBaseMethods.SqlSearchComponent("Piece", "largeur", "hauteur", "Couleur", "Ref", size, (height).ToString(), colorDoor, "Porte", conn); componentDict.Add("Door", ReaderData(order, door, typeof(Door))); } else { Console.WriteLine("No doors"); componentDict.Add("Door", new Dictionary <string, object>() { { "Component", null } }); } var slider = DataBaseMethods.SqlSearchComponent("Piece", "largeur", "hauteur", "Couleur", "Ref", "0", height, "", "Tasseau", conn); componentDict.Add("Slider", ReaderData(order, slider, typeof(Slider))); var traverseFront = DataBaseMethods.SqlSearchComponent("Piece", "largeur", "profondeur", "Ref", "Ref", width, "0", "Traverse Av", "Traverse Av", conn); componentDict.Add("TraverseFront", ReaderData(order, traverseFront, typeof(Traverse))); var traverseBack = DataBaseMethods.SqlSearchComponent("Piece", "largeur", "profondeur", "Ref", "Ref", width, "0", "Traverse Ar", "Traverse Ar", conn); componentDict.Add("TraverseBack", ReaderData(order, traverseBack, typeof(Traverse))); var traverseSides = DataBaseMethods.SqlSearchComponent("Piece", "profondeur", "largeur", "Ref", "Ref", depth, "0", "Traverse GD", "Traverse GD", conn); componentDict.Add("TraverseSides", ReaderData(order, traverseSides, typeof(Traverse))); var cups = DataBaseMethods.SqlSearchComponent("Piece", "profondeur", "largeur", "Ref", "Ref", "0", "0", "Coupelles", "Coupelles", conn); componentDict.Add("Cups", colorDoor != "I don't want a door" && colorDoor != "Verre" ? ReaderData(order, cups, typeof(Cups)) : new Dictionary <string, object>() { { "Component", null } }); conn.Close(); return(componentDict); }