Пример #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            using (var frm = new frmSet())
            {
                if (frm.ShowDialog() == DialogResult.Cancel) return;

                var image = frm.pbImage.Image;
                var name = frm.txtName.Text.Trim();

                Dal.AddOrUpdateExercise(null, image.ConvertTo64BaseString(), name);

            }

            LoadData();
        }
Пример #2
0
        void EditExercise(DataRow set)
        {
            using (var frm = new frmSet())
            {
                frm.btnAdd.Text = "שמור";
                frm.Text = "עריכת תרגיל";
                frm.txtName.Text = set["Name"].ToString();
                //  frm.pbImage.Image = set.ConvertedImage;

                if (frm.ShowDialog() == DialogResult.Cancel) return;

                //set["Name"] = frm.txtName.Text;
                //set["Image"] = frm.pbImage.Image.ConvertTo64BaseString();
                Dal.AddOrUpdateExercise((int)set["id"], frm.pbImage.Image.ConvertTo64BaseString(), frm.txtName.Text);
            }
        }