private void checkDataChanged(int ID) { SqlConnection con = new SqlConnection("Data Source=luxefood.database.windows.net;Initial Catalog=LuxeFoods;User ID=Klees;Password=Johnny69;Connect Timeout=60;Encrypt=True;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False"); DataSet ds = new DataSet(); con.Open(); SqlCommand read = new SqlCommand($"SELECT * from [restaurant] WHERE id='{ID}'", con); SqlDataAdapter adapt = new SqlDataAdapter(read); adapt.FillSchema(ds, SchemaType.Source, "Restauranten"); adapt.Fill(ds, "Restauranten"); con.Close(); DataTable tblRestauranten = ds.Tables["Restauranten"]; foreach (DataRow x in tblRestauranten.Rows) { if (textBox1.Text != "" && textBox1.Text != x["naam"].ToString()) { EditButton.Show(); } else { EditButton.Hide(); } } }
private void checkDataChanged(int ID) { SqlConnection con = new SqlConnection("Data Source=luxefood.database.windows.net;Initial Catalog=LuxeFoods;User ID=Klees;Password=Johnny69;Connect Timeout=60;Encrypt=True;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False"); DataSet ds = new DataSet(); con.Open(); SqlCommand read = new SqlCommand($"SELECT * from [reservering] WHERE Id='{ID}'", con); SqlDataAdapter adapt = new SqlDataAdapter(read); adapt.FillSchema(ds, SchemaType.Source, "Reservering"); adapt.Fill(ds, "Reservering"); con.Close(); DataTable tblReservering = ds.Tables["Reservering"]; int seatNr = 0; if (availableSeatsListBox.SelectedItem != null) { if (availableSeatsListBox.SelectedItem.ToString() != "Current Seat") { string strSource = availableSeatsListBox.SelectedItem.ToString(); string strStart = "Seat nr: "; if (strSource.Contains(strStart)) { int start, end; start = strSource.IndexOf(strStart, 0) + strStart.Length; end = strSource.Length; string reservationID = strSource.Substring(start, end - start); string seatNrStr = string.Empty; for (int i = 0; i < reservationID.Length; i++) { if (Char.IsDigit(reservationID[i])) { seatNrStr += reservationID[i]; } } seatNr = Int32.Parse(seatNrStr); } } } foreach (DataRow x in tblReservering.Rows) { if (((int)x["restaurantId"] != (int)RestaurantPicker.SelectedValue) || ((DateTime)x["datum"] != dateTimePicker1.Value) || ((int)x["tafelNummer"] != seatNr && (DateTime)x["datum"] == dateTimePicker1.Value && seatNr != 0)) { EditButton.Show(); } else { EditButton.Hide(); } } }
void preview_Closed(object sender, EventArgs e) { GetProjectDetails(id); if (Controllers.User != "admin") { EditButton.Hide(); } GetTasks(id); }
public LiveCardDataPreview() { InitializeComponent(); EditAddPanel.Hide(); //_instanceOfForm2 = new LiveCardInputForm(); Adddetails.Hide(); EditButton.Hide(); /* bunifuImageButton1.Hide();*/ }
public MenuDashboardGerechtOverview(int menuId, int adminID, string previous = "") { globalMenuId = menuId; globalAdminID = adminID; globalPrevious = previous; InitializeComponent(); CenterToScreen(); FillDashboard(); EditButton.Hide(); }
public ProjectPreview(int id) { this.id = id; InitializeComponent(); GetProjectDetails(id); if (Controllers.User != "admin") { EditButton.Hide(); } GetTasks(id); }
// Button sửa private void EditButton_Click(object sender, EventArgs e) { AddBt.Hide(); EditButton.Hide(); DeleteButton.Hide(); SaveAddBt.Hide(); CancelAddBt.Hide(); SaveEditButton.Show(); CancelEdit.Show(); textBox6.Enabled = true; textBox9.Enabled = true; textBox8.Enabled = true; textBox7.Enabled = true; radioButton5.Enabled = true; radioButton6.Enabled = true; dateTimePicker4.Enabled = true; dateTimePicker5.Enabled = true; dateTimePicker6.Enabled = true; }
private void checkDataChanged(int ID) { SqlConnection con = new SqlConnection("Data Source=luxefood.database.windows.net;Initial Catalog=LuxeFoods;User ID=Klees;Password=Johnny69;Connect Timeout=60;Encrypt=True;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False"); DataSet ds = new DataSet(); con.Open(); SqlCommand read = new SqlCommand($"SELECT * from [gerecht] WHERE id='{globalMenuId}'", con); SqlDataAdapter adapt = new SqlDataAdapter(read); adapt.FillSchema(ds, SchemaType.Source, "Gerechten"); adapt.Fill(ds, "Gerechten"); con.Close(); DataTable tblGerechten = ds.Tables["Gerechten"]; int prijsInt = 0; if (gerechtPrijsInput.Text != "") { string prijsStr = string.Empty; for (int i = 0; i < gerechtPrijsInput.Text.Length; i++) { if (Char.IsDigit(gerechtPrijsInput.Text[i])) { prijsStr += gerechtPrijsInput.Text[i]; } } prijsInt = Int32.Parse(prijsStr); } foreach (DataRow x in tblGerechten.Rows) { if ((gerechtNaamInput.Text != "" && x["naam"].ToString() != gerechtNaamInput.Text) || (gerechtPrijsInput.Text != "" && (int)x["prijs"] != prijsInt) || x["melkalergieen"].ToString() != (string)gerechtMelkSelector.SelectedItem || x["notenalergieen"].ToString() != (string)gerechtNotenSelector.SelectedItem || x["categorie"].ToString() != (string)gerechtCategorieSelector.SelectedItem) { EditButton.Show(); } else { EditButton.Hide(); } } }
private void InitFields(region region) { if (region == null) { AddDepartmentButton.Show(); EditButton.Hide(); return; } AddDepartmentButton.Hide(); EditButton.Show(); var context = new PSOConnect(); var department = context.department.FirstOrDefault(departments => departments.idDepartment == region.idDepartment); var mainDepartment = context.mainDepartment.FirstOrDefault(mainDepartments => mainDepartments.idMainDepartment == department.idMainDepartment); RegionField.Text = region.address; DepartmentField.Text = department.address; MainDepartmentField.Text = mainDepartment.address; }
public MacroForm() { InitializeComponent(); FormBorderStyle = FormBorderStyle.FixedSingle; MaximizeBox = false; ScrollBar vScrollBar1 = new VScrollBar(); vScrollBar1.Dock = DockStyle.Right; vScrollBar1.Scroll += (sender, e) => { SettingsPanel.VerticalScroll.Value = vScrollBar1.Value; }; vScrollBar1.LargeChange = vScrollBar1.Maximum / 2; SettingsPanel.Controls.Add(vScrollBar1); ScriptBox.SelectedIndexChanged += ScriptBox_Changed; ScriptBox.DataSource = Script.ScriptList; if (Script.ScriptList.Count > 0) { ScriptBox.SelectedIndex = 0; } PresetLabel.Text = "Preset: " + Preset.Current.m_Name; DescriptionLabel.MaximumSize = new Size(SettingsPanel.Width - 3, 0); DescriptionLabel.AutoSize = true; HLine.BorderStyle = BorderStyle.Fixed3D; ActiveControl = PresetLabel; // Focus the the preset label for aesthetics ReloadSplitButton.FlatStyle = FlatStyle.Flat; ContextMenuStrip menu = new ContextMenuStrip(); menu.Items.Add("Current"); menu.Items.Add("All"); menu.ItemClicked += new ToolStripItemClickedEventHandler(ReloadItem_Clicked); ReloadSplitButton.ContextMenuStrip = menu; EditButton.Hide(); }
public AdminOrderReviewDashboard(int ID, int adminID, string previous = "", string option = "", string keywords = "") { /* TODO * Edit Details of the order (FINISHED) * Show Customer Contact Info (DONE) * Edit Customer Info Button (FINISHED) * - Should take to seperate window where the you can change customers info (DONE) * Option to delete order * Option to go back to the Dasboard (DONE) */ globalId = ID; globalPrevious = previous; globalOption = option; globalKeywords = keywords; globalAdminID = adminID; InitializeComponent(); CenterToScreen(); fillDashboard(ID); fillComboBox(ID); setDateTimePicker(ID); EditButton.Hide(); updateAvailableSeats(); }