Exemplo n.º 1
0
        private void btnadd_Click(object sender, EventArgs e)
        {
            if (txt_name.Text == "" || txt_location.Text == "" || txt_email.Text == "")
            {
                PL.FRM_ERRORINSERT FError = new FRM_ERRORINSERT();
                FError.Show();
            }
            else
            {
                MemoryStream ma = new MemoryStream();
                cover.Image.Save(ma, System.Drawing.Imaging.ImageFormat.Jpeg);
                if (ID == 0)
                {
                    BL.CLS_ST BLST = new BL.CLS_ST();
                    BLST.Insert(txt_name.Text, txt_location.Text, txt_phone.Text, txt_email.Text, txt_school.Text, txt_dep.Text, ma);

                    PL.FRM_DADD fadd = new FRM_DADD();
                    fadd.Show();
                    this.Close();
                }
                else
                {
                    BL.CLS_ST BLST = new BL.CLS_ST();
                    BLST.Update(txt_name.Text, txt_location.Text, txt_phone.Text, txt_email.Text, txt_school.Text, txt_dep.Text, ma, ID);
                    PL.FRM_DEDIT fedit = new FRM_DEDIT();
                    fedit.Show();
                    this.Close();
                }
            }
        }