Beispiel #1
0
        private void Form11_Load(object sender, EventArgs e)
        {
            cmbProduct.Items.Clear();
            cmbClient.Items.Clear();
            cboManufac.Items.Clear();

            FillOrderGrid();

            txtOrderID.Text = GenerateID.Get(Enums.IDType.PUOR);

            cmbProduct.DataSource = GetData.SelectAll(Enums.IDType.PROD);
            cmbClient.DataSource  = GetData.SelectAll(Enums.IDType.CLNT);
            cboManufac.DataSource = GetData.SelectAll(Enums.IDType.MANF);
        }
Beispiel #2
0
        public static string Get(Enums.IDType idType)
        {
            var chars  = "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ";
            var random = new Random();
            var result = new string(
                Enumerable.Repeat(chars, 5)
                .Select(s => s[random.Next(s.Length)])
                .ToArray());

            GenerateID dig = new GenerateID();

            if (dig.Available(result, idType))
            {
                return(Get(idType));
            }
            else
            {
                return(idType.ToString() + result);
            }
        }