示例#1
0
        private void btnFinish_Click(object sender, EventArgs e)
        {
            if (CheckInput() == false)
            {
                return;
            }
            SaveUser();
            SaveProduct();
            FormConfirm frmConfirm = new FormConfirm();

            frmConfirm.Products = _products;
            frmConfirm.Show();
            this.Hide();
        }
示例#2
0
        private void BatchUpload()
        {
            if (CheckMutipleUploadParameters() == false)
            {
                return;
            }
            NewUsername = this.cmbUsername.Text.Trim();
            NewPasswrod = this.txtBatchPassword.Text.Trim();
            SaveUser();

            SelectedProducts.Clear();
            for (int i = 0; i < dataGridView.SelectedRows.Count; i++)
            {
                Product p = dataGridView.SelectedRows[i].DataBoundItem as Product;
                if (p == null)
                {
                    throw new Exception("Product config error!");
                }
                p.Id                = Guid.NewGuid().ToString();
                p.Username          = NewUsername;
                p.Password          = NewPasswrod;
                p.UploadDateTime    = DateTime.Now;
                p.UploadFailedReson = "";
                p.UploadResult      = "";
                p.Pictures          = new List <Image>();
                foreach (string imagePath in p.ImagePaths)
                {
                    p.Pictures.Add(Image.FromFile(imagePath));
                }
                p.ImagePaths.Clear();
                SelectedProducts.Add(p);
            }

            FormConfirm frmConfirm = new FormConfirm();

            frmConfirm.Products = SelectedProducts;
            frmConfirm.Show();
            this.Hide();
        }