Exemple #1
0
        /// <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();
        }
Exemple #2
0
        private void chKodyK_Click(object sender, EventArgs e)
        {
            CommentsForm Comm = new CommentsForm(this, KodyK);

            if (Comm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                KodyK = Comm.textBox1.Text.Trim();
                string[] Kody = KodyK.Split((char)10);
                foreach (string kod in Kody)
                {
                    if (kod.Trim() == "" || !IsDigitsOnly(kod))
                    {
                        KodyK = "";
                        MessageBox.Show("Nieprawidłowy kod kreskowy", kod, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }
                }
                //bool isUnique = Kody.Distinct().Count() == Kody.Count();
                HashSet <string> s = new HashSet <string>(Kody);
                if (s.Count != Kody.Length)
                {
                    KodyK = "";
                    MessageBox.Show("Wpisano powtarzjące się kody kreskowe", "Informacja", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
                if (WNumberTextBox.Text.Trim() != Kody.Length.ToString())
                {
                    KodyK = "";
                    MessageBox.Show("Wpisano nieprawidłową ilość się kodów kreskowych", Kody.Length.ToString(), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
            }


            if (KodyK != null && KodyK.Trim() == "")
            {
                chKodyK.Checked = false;
            }
            else
            {
                chKodyK.Checked = true;
            }

            Comm.Dispose();
        }
Exemple #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CommentsCheckBox_Click(object sender, EventArgs e)
        {
            CommentsForm Comm = new CommentsForm(Comments, this);

            if (Comm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                Comments = Comm.textBox1.Text;
            }

            if (Comments != null && Comments.Trim() == "")
            {
                CommentsCheckBox.Checked = false;
            }
            else
            {
                CommentsCheckBox.Checked = true;
            }

            Comm.Dispose();
        }