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(); } } }
private void btnadd_Click(object sender, EventArgs e) { if (txt_title.Text == "") { PL.FRM_ERRORINSERT FError = new FRM_ERRORINSERT(); FError.Show(); } else { if (ID == 0) { BL.CLS_BRO BLBR = new BL.CLS_BRO(); BLBR.Insert(Convert.ToString(dataGridView1.CurrentRow.Cells[1].Value), Convert.ToString(dataGridView2.CurrentRow.Cells[1].Value), Convert.ToString(txt_date1.Value), Convert.ToString(txt_date2.Value), Convert.ToInt32(txt_title.Text)); PL.FRM_DADD fadd = new FRM_DADD(); fadd.Show(); this.Close(); } else { BL.CLS_BRO BLBR = new BL.CLS_BRO(); BLBR.update(Convert.ToString(dataGridView1.CurrentRow.Cells[1].Value), Convert.ToString(dataGridView2.CurrentRow.Cells[1].Value), Convert.ToString(txt_date1.Value), Convert.ToString(txt_date2.Value), Convert.ToInt32(txt_title.Text), ID); PL.FRM_DEDIT fedit = new FRM_DEDIT(); fedit.Show(); this.Close(); } } }
private void btnadd_Click(object sender, EventArgs e) { if (txt_title.Text == "" || txt_auther.Text == "" || txt_price.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_BOOKS BLBOOKS = new BL.CLS_BOOKS(); BLBOOKS.Insert(txt_title.Text, txt_auther.Text, comboBox1.Text, txt_price.Text, txt_rate.Value, ma); PL.FRM_DADD fadd = new FRM_DADD(); fadd.Show(); this.Close(); } else { BL.CLS_BOOKS BLBOOKS = new BL.CLS_BOOKS(); BLBOOKS.Update(txt_title.Text, txt_auther.Text, comboBox1.Text, txt_price.Text, txt_rate.Value, ma, ID); PL.FRM_DEDIT fedit = new FRM_DEDIT(); fedit.Show(); this.Close(); } } }
private void btnadd_Click(object sender, EventArgs e) { if (txt_catname.Text == "") { PL.FRM_ERRORINSERT FError = new FRM_ERRORINSERT(); FError.Show(); } else { if (ID == 0) { BL.CLS_CAT BLCAT = new BL.CLS_CAT(); BLCAT.Insert(txt_catname.Text); PL.FRM_DADD fadd = new FRM_DADD(); fadd.Show(); this.Close(); } else { BL.CLS_CAT BLCAT = new BL.CLS_CAT(); BLCAT.Update(txt_catname.Text, ID); PL.FRM_DEDIT fedit = new FRM_DEDIT(); fedit.Show(); this.Close(); } } }
private void btnadd_Click(object sender, EventArgs e) { if (txt_name.Text == "" || txt_password.Text == "") { PL.FRM_ERRORINSERT FError = new FRM_ERRORINSERT(); FError.Show(); } else { if (ID == 0) { BL.CLS_USERS BLuser = new BL.CLS_USERS(); BLuser.Insert(txt_name.Text, txt_password.Text, txt_prem.Text, "false"); PL.FRM_DADD fadd = new FRM_DADD(); fadd.Show(); this.Close(); } else { BL.CLS_USERS BLuser = new BL.CLS_USERS(); BLuser.update(txt_name.Text, txt_password.Text, txt_prem.Text, ID); PL.FRM_DEDIT fedit = new FRM_DEDIT(); fedit.Show(); this.Close(); } } }