/// <summary> /// Funkcja obsługująca CheckBox z uwagami. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void CommentsCheckBox_Click(object sender, EventArgs e) { ActiveReason = FormActivate.faCommentsForm; Comm = new CommentsForm(Comments, this, Mode == "usun"); Comm.Show(); }
private void AkcesjaForm_Activated(object sender, EventArgs e) { if (ActiveReason == FormActivate.faCommentsForm) { CommentsCheckBox.Checked = !string.IsNullOrEmpty(Comments.Trim()); //Comments.Trim() != ""; if (Comm.DialogResult != DialogResult.OK) { return; } Comments = Comm.textBox1.Text.Trim(); CommentsCheckBox.Checked = !string.IsNullOrEmpty(Comments.Trim());//Comments.Trim() != ""; if (Mode != "dopisz") { return; } SqlCommand Command = new SqlCommand(); Command.CommandText = "EXEC Akcesja_UpdateComments @kod, @uwagi; "; Command.Parameters.AddWithValue("@kod", this.AkcesjaCode); Command.Parameters.AddWithValue("@uwagi", Comments); CommonFunctions.WriteData(Command, ref Settings.Connection); } ActiveReason = FormActivate.faMainForm; }
public ArtykulyForm(KindEnum Kind, ModeEnum Mode) { InitializeComponent(); setControlsText(); this.ActiveReason = FormActivate.faMainForm; CurrentKind = Kind; CurrentMode = Mode; loadConfig(); AuthorsToDelete = new List <string>(); KeysToDelete = new List <string>(); ShowList = false; if (CurrentKind == KindEnum.Magazine) { KindUC = new MagazineUC(); //KindUC.Location = new Point(12, 438); //this.Controls.Add(KindUC); KindUC.Location = new Point(0, 0); panel1.Controls.Add(KindUC); } else if (CurrentKind == KindEnum.Book) { KindUC = new BookUC(); //KindUC.Location = new Point(12, 438); //this.Controls.Add(KindUC); KindUC.Location = new Point(0, 0); panel1.Controls.Add(KindUC); } if (CurrentMode == ModeEnum.Edit || CurrentMode == ModeEnum.Delete) { SearchButton.Visible = true; PrintButton.Visible = true; } if (CurrentMode == ModeEnum.Delete) { DeleteButton.Visible = true; Settings.ReadOnlyMode = true; LockAll(); } if (CurrentMode == ModeEnum.ReadOnlyCatalog) { Settings.ReadOnlyMode = true; ReadOnlyForCatalog(); } ToolTip SelectToolTip = new ToolTip(); SelectToolTip.SetToolTip(SourcesButton, _translationsDictionary.getStringFromDictionary("add_attachments", "Dodaj załączniki")); keySuggest(""); }
/// <summary> /// Konstruktor Akcesji. /// </summary> /// <param name="id_rodzaj"> /// id_rodzaj inwentarza. /// </param> /// <param name="Mode"> /// Tryb działania programu: /// 1. "nowa_karta" - można dodać tylko nową kartę akcesji /// 2. "dopisz" - można dopisywać numery akcesyjne /// 3. "usun" - można tylko usunąć akcesję /// </param> public AkcesjaForm(int id_rodzaj, string Mode, string employeeID, Form mdiParent) { InitializeComponent(); setControlsText(); ActiveReason = FormActivate.faMainForm; this.MdiParent = mdiParent; //Pobiera ConnectionString IniFile Configs = new IniFile("coliber.ini", "coliber", false); Settings.SetSettings(Configs.ReadIni("SqlServer", "ConnectionString"), id_rodzaj); Settings.employeeID = employeeID; //Generuje słownik częstotliwości FreqComboBoxValuesDictionary = new Dictionary <int, string>(); GenerateFreqComboBoxValues(); FreqComboBox.DataSource = new BindingSource(FreqComboBoxValuesDictionary, null); FreqComboBox.ValueMember = "Key"; FreqComboBox.DisplayMember = "Value"; //Generuje słownik z wartościami dla przepisywania numerów akcesyjnych RewritingValuesDictionary = new Dictionary <int, string>(); GenerateNumbers(); RewritingNumbersComboBox.DataSource = new BindingSource(RewritingValuesDictionary, null); RewritingNumbersComboBox.ValueMember = "Key"; RewritingNumbersComboBox.DisplayMember = "Value"; Comments = ""; this.Mode = Mode; InitModule(true); SetToolTips(); }
private void ArtykulyForm_Activated(object sender, EventArgs e) { if (ActiveReason == FormActivate.faAuthorsForm) { if (SLF.DialogResult == DialogResult.OK) { bool NotExists = true; for (int i = 0; i < AuthorsDGV.Rows.Count; i++) { NotExists = true; for (int j = 0; j < SLF.SelectedDataGridView.Rows.Count; j++) { if (AuthorsDGV.Rows[i].Cells["IDAuthorsDGV"].Value.ToString() == SLF.SelectedDataGridView.Rows[j].Cells["id"].Value.ToString()) { NotExists = false; } } if (NotExists) { AuthorsToDelete.Add(AuthorsDGV.Rows[i].Cells["IDAuthorsDGV"].Value.ToString()); } } if (AuthorsDGV.Rows.Count > 0) { AuthorsDGV.Rows.Clear(); } DataGridViewRow Row; for (int i = 0; i < SLF.SelectedDataGridView.Rows.Count; i++) { Row = (DataGridViewRow)SLF.SelectedDataGridView.Rows[i].Clone(); for (int j = 0; j < SLF.SelectedDataGridView.Rows[i].Cells.Count; j++) { Row.Cells[j].Value = SLF.SelectedDataGridView.Rows[i].Cells[j].Value; } AuthorsDGV.Rows.Add(Row); } } } else if (ActiveReason == FormActivate.faKeysForm) { if (SLF.DialogResult == DialogResult.OK) { bool NotExists = true; for (int i = 0; i < KeysDGV.Rows.Count; i++) { NotExists = true; for (int j = 0; j < SLF.SelectedDataGridView.Rows.Count; j++) { if (KeysDGV.Rows[i].Cells["IDKeysDGV"].Value.ToString() == SLF.SelectedDataGridView.Rows[j].Cells["id"].Value.ToString()) { NotExists = false; } } if (NotExists) { KeysToDelete.Add(KeysDGV.Rows[i].Cells["IDKeysDGV"].Value.ToString()); } } if (KeysDGV.Rows.Count > 0) { KeysDGV.Rows.Clear(); } DataGridViewRow Row; for (int i = 0; i < SLF.SelectedDataGridView.Rows.Count; i++) { Row = (DataGridViewRow)SLF.SelectedDataGridView.Rows[i].Clone(); for (int j = 0; j < SLF.SelectedDataGridView.Rows[i].Cells.Count; j++) { Row.Cells[j].Value = SLF.SelectedDataGridView.Rows[i].Cells[j].Value; } KeysDGV.Rows.Add(Row); } } } ActiveReason = FormActivate.faMainForm; }
private void ChooseKeyButton_Click(object sender, EventArgs e) { WaitForm WF = new WaitForm(); this.Invoke((MethodInvoker) delegate { WF.Show(this); WF.Update(); }); SqlCommand Command = new SqlCommand(); Command.CommandText = "EXEC ZwrocKluczeArtykuly @id_rodzaj;"; Command.Parameters.AddWithValue("@id_rodzaj", Settings.ID_rodzaj); DataGridViewColumn[] Columns = new DataGridViewColumn[2]; Columns[0] = new DataGridViewColumn(new DataGridViewTextBoxCell()); Columns[0].DataPropertyName = "id"; Columns[0].Name = "id"; Columns[1] = new DataGridViewColumn(new DataGridViewTextBoxCell()); Columns[1].DataPropertyName = "klucze"; Columns[1].Name = "Klucze"; Columns[1].HeaderText = _translationsDictionary.getStringFromDictionary("keys", "Klucze"); SLF = new ShowListForm(KeysDGV, Command, Columns, this); ActiveReason = FormActivate.faKeysForm; SLF.Show(); WF.Close(); /*if (SLF.ShowDialog() == System.Windows.Forms.DialogResult.OK) * { * bool NotExists = true; * * for (int i = 0; i < KeysDGV.Rows.Count; i++) * { * NotExists = true; * * for (int j = 0; j < SLF.SelectedDataGridView.Rows.Count; j++) * { * if (KeysDGV.Rows[i].Cells["IDKeysDGV"].Value.ToString() == SLF.SelectedDataGridView.Rows[j].Cells["id"].Value.ToString()) * NotExists = false; * } * * if (NotExists) * KeysToDelete.Add(KeysDGV.Rows[i].Cells["IDKeysDGV"].Value.ToString()); * } * * if (KeysDGV.Rows.Count > 0) * KeysDGV.Rows.Clear(); * * DataGridViewRow Row; * * for (int i = 0; i < SLF.SelectedDataGridView.Rows.Count; i++) * { * Row = (DataGridViewRow)SLF.SelectedDataGridView.Rows[i].Clone(); * * for (int j = 0; j < SLF.SelectedDataGridView.Rows[i].Cells.Count; j++) * { * Row.Cells[j].Value = SLF.SelectedDataGridView.Rows[i].Cells[j].Value; * } * * KeysDGV.Rows.Add(Row); * } * }*/ }
private void BtnActivate_Click(object sender, EventArgs e) { FormActivate Activate = new FormActivate(); Activate.ShowDialog(); }