You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.6 KiB

using Database;
using OnDoc.Klassen;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace OnDoc.Diverses
{
public partial class SaveAnsicht : Form
{
public string selectedtext = "";
public int alsStandard = 0;
public SaveAnsicht()
{
InitializeComponent();
}
private void SaveAnsicht_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
DB dB = new DB(AppParams.connectionstring);
dB.Get_Tabledata("Select * from mitarbeiter_gridsettings where bezeichnung = '" + textBox1.Text + "' and mitarbeiterid=" + AppParams.CurrentMitarbeiter.ToString() + " and aktiv=1", false, true);
int cnt=dB.dsdaten.Tables[0].Rows.Count;
dB = null;
if (cnt > 0)
{
MessageBox.Show("Ansicht mit diesem Namen ist bereits vorhanden. Bitte anpassen", "Ansicht speichern", MessageBoxButtons.OK, MessageBoxIcon.Error);
textBox1.Focus();
return;
}
selectedtext = textBox1.Text;
if (checkBox1.Checked) { alsStandard = 1; }
DialogResult = DialogResult.OK;
this.Close();
}
private void button2_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
this.Close();
}
}
}