private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { PL.FRM_ADDCAT FCAT = new FRM_ADDCAT(); FCAT.btnadd.ButtonText = "اضافة"; FCAT.ID = 0; FCAT.Show(); }
private void bunifuThinButton21_Click(object sender, EventArgs e) { //ADDCAT if (state == "CAT") { PL.FRM_ADDCAT FCAT = new FRM_ADDCAT(); FCAT.btnadd.ButtonText = "اضافة"; FCAT.ID = 0; bunifuTransition1.ShowSync(FCAT); } if (state == "BOOKS") { PL.FRM_ADDBOOKS fbooks = new FRM_ADDBOOKS(); fbooks.btnadd.ButtonText = "اضافة"; fbooks.ID = 0; bunifuTransition1.ShowSync(fbooks); } if (state == "ST") { PL.FRM_ADDSTUDINT fsell = new FRM_ADDSTUDINT(); fsell.btnadd.ButtonText = "اضافة"; fsell.ID = 0; bunifuTransition1.ShowSync(fsell); } if (state == "SELL") { PL.FRM_MAKESELL fst = new FRM_MAKESELL(); fst.btnadd.ButtonText = "اضافة"; fst.ID = 0; bunifuTransition1.ShowSync(fst); } if (state == "BRO") { PL.FRM_BRO fBR = new FRM_BRO(); fBR.btnadd.ButtonText = "اضافة"; fBR.ID = 0; bunifuTransition1.ShowSync(fBR); } if (state == "USER") { PL.FRM_ADDUSER fuser = new FRM_ADDUSER(); fuser.btnadd.ButtonText = "اضافة"; fuser.ID = 0; bunifuTransition1.ShowSync(fuser); } }
private void FRM_MAIN_Activated(object sender, EventArgs e) { if (state == "CAT") { PL.FRM_ADDCAT FCAT = new FRM_ADDCAT(); FCAT.btnadd.ButtonText = "اضافة"; FCAT.ID = 0; bunifuTransition1.ShowSync(FCAT); } DataTable d = new DataTable(); d = BLBOOKS.Load(); label2.Text = d.Rows.Count.ToString(); DataTable dt1 = new DataTable(); dt1 = BLST.Load(); label5.Text = dt1.Rows.Count.ToString(); DataTable m = new DataTable(); m = BLSELL.Load(); label7.Text = m.Rows.Count.ToString(); DataTable u = new DataTable(); u = BLBRO.Load(); label13.Text = u.Rows.Count.ToString(); DataTable t = new DataTable(); t = BLUSER.Load(); label9.Text = t.Rows.Count.ToString(); DataTable j = new DataTable(); j = BLCAT.Load(); label11.Text = j.Rows.Count.ToString(); if (lb_prem.Text == "مدير") { bunifuThinButton22.Enabled = true; button6.Enabled = true; } else { bunifuThinButton22.Enabled = false; button6.Enabled = false; } if (state == "CAT") { //Load Data Cat try { DataTable dt = new DataTable(); dt = BLCAT.Load(); dataGridView1.DataSource = dt; dataGridView1.Columns[0].HeaderText = "التسلسل"; dataGridView1.Columns[1].HeaderText = "اسم الصنف"; } catch (Exception ex) { MessageBox.Show(ex.Message); } } else if (state == "BOOKS") { P_HOME.Visible = false; P_MAIN.Visible = true; bunifuThinButton24.Visible = true; state = "BOOKS"; Lb_Title.Text = "الكتب"; //Load Data DataTable dt = new DataTable(); dt = BLBOOKS.Load(); dataGridView1.DataSource = dt; dataGridView1.Columns[0].HeaderText = "التسلسل"; dataGridView1.Columns[1].HeaderText = "اسم الكتاب"; dataGridView1.Columns[2].HeaderText = "المؤلف"; dataGridView1.Columns[3].HeaderText = "التصنيف"; dataGridView1.Columns[4].HeaderText = "السعر"; } else if (state == "ST") { P_MAIN.Visible = true; P_HOME.Visible = false; state = "ST"; Lb_Title.Text = "الطلاب"; try { DataTable dt = new DataTable(); dt = BLST.Load(); dataGridView1.DataSource = dt; dataGridView1.Columns[0].HeaderText = "التسلسل"; dataGridView1.Columns[1].HeaderText = "اسم الطالب"; dataGridView1.Columns[2].HeaderText = "السكن"; dataGridView1.Columns[3].HeaderText = "رقم الهاتف"; dataGridView1.Columns[4].HeaderText = "ايميل"; } catch (Exception ex) { MessageBox.Show(ex.Message); } } else if (state == "SELL") { P_MAIN.Visible = true; P_HOME.Visible = false; state = "SELL"; Lb_Title.Text = "البيع"; try { DataTable dt = new DataTable(); dt = BLSELL.Load(); dataGridView1.DataSource = dt; dataGridView1.Columns[0].HeaderText = "التسلسل"; dataGridView1.Columns[1].HeaderText = "اسم الكتاب"; dataGridView1.Columns[2].HeaderText = "المشتري"; dataGridView1.Columns[3].HeaderText = "السعر"; } catch (Exception ex) { MessageBox.Show(ex.Message); } } else if (state == "BRO") { P_MAIN.Visible = true; P_HOME.Visible = false; state = "BRO"; Lb_Title.Text = "الاستعارة"; DataTable dt = new DataTable(); try { dt = BLBRO.Load(); dataGridView1.DataSource = dt; dataGridView1.Columns[0].HeaderText = "التسلسل"; dataGridView1.Columns[1].HeaderText = "اسم المشتري"; dataGridView1.Columns[2].HeaderText = "اسم الكتاب"; dataGridView1.Columns[3].HeaderText = "بداية الاستعارة"; dataGridView1.Columns[4].HeaderText = "تهاية الاستعارة"; dataGridView1.Columns[5].HeaderText = "السعر"; } catch (Exception ex) { MessageBox.Show(ex.Message); } } else if (state == "USER") { P_MAIN.Visible = true; P_HOME.Visible = false; state = "USER"; Lb_Title.Text = "المستخدمين"; DataTable dt = new DataTable(); try { dt = BLUSER.Load(); dataGridView1.DataSource = dt; dataGridView1.Columns[0].HeaderText = "التسلسل"; dataGridView1.Columns[1].HeaderText = "اسم المستخدم"; dataGridView1.Columns[2].HeaderText = "كلمة السر"; dataGridView1.Columns[3].HeaderText = "الصلاحية"; } catch (Exception ex) { MessageBox.Show(ex.Message); } } }
private void bunifuThinButton23_Click(object sender, EventArgs e) { if (state == "CAT") { PL.FRM_ADDCAT FCAT = new FRM_ADDCAT(); FCAT.btnadd.ButtonText = "تعديل"; FCAT.txt_catname.Text = Convert.ToString(dataGridView1.CurrentRow.Cells[1].Value); FCAT.ID = Convert.ToInt16(dataGridView1.CurrentRow.Cells[0].Value); bunifuTransition1.ShowSync(FCAT); } else if (state == "BOOKS") { PL.FRM_ADDBOOKS Fbooks = new FRM_ADDBOOKS(); Fbooks.btnadd.ButtonText = "تعديل"; Fbooks.ID = Convert.ToInt16(dataGridView1.CurrentRow.Cells[0].Value); DataTable dt = new DataTable(); dt = BLBOOKS.LOADEDIT(Convert.ToInt16(dataGridView1.CurrentRow.Cells[0].Value)); object obj1 = dt.Rows[0]["TITLE"]; object obj2 = dt.Rows[0]["AUTHER"]; object obj3 = dt.Rows[0]["CAT"]; object obj4 = dt.Rows[0]["PRICE"]; object obj5 = dt.Rows[0]["RATE"]; object obj6 = dt.Rows[0]["COVER"]; Fbooks.txt_title.Text = obj1.ToString(); Fbooks.txt_auther.Text = obj2.ToString(); Fbooks.comboBox1.Text = obj3.ToString(); Fbooks.txt_price.Text = obj4.ToString(); Fbooks.txt_rate.Value = (int)obj5; Byte[] ob = (Byte[])obj6; MemoryStream ma = new MemoryStream(ob); Fbooks.cover.Image = Image.FromStream(ma); bunifuTransition1.ShowSync(Fbooks); } else if (state == "ST") { PL.FRM_ADDSTUDINT Fst = new FRM_ADDSTUDINT(); Fst.btnadd.ButtonText = "تعديل"; Fst.ID = Convert.ToInt16(dataGridView1.CurrentRow.Cells[0].Value); DataTable dt = new DataTable(); dt = BLST.LOADEDIT(Convert.ToInt16(dataGridView1.CurrentRow.Cells[0].Value)); object obj1 = dt.Rows[0]["NAME"]; object obj2 = dt.Rows[0]["TLOCATION"]; object obj3 = dt.Rows[0]["PHONE"]; object obj4 = dt.Rows[0]["EMAIL"]; object obj5 = dt.Rows[0]["SCHOOL"]; object obj6 = dt.Rows[0]["DEP"]; object obj7 = dt.Rows[0]["COVER"]; Fst.txt_name.Text = obj1.ToString(); Fst.txt_location.Text = obj2.ToString(); Fst.txt_phone.Text = obj3.ToString(); Fst.txt_email.Text = obj4.ToString(); Fst.txt_school.Text = obj5.ToString(); Fst.txt_dep.Text = obj6.ToString(); Byte[] ob = (Byte[])obj7; MemoryStream ma = new MemoryStream(ob); Fst.cover.Image = Image.FromStream(ma); bunifuTransition1.ShowSync(Fst); } else if (state == "SELL") { PL.FRM_MAKESELL Fsell = new FRM_MAKESELL(); Fsell.btnadd.ButtonText = "تعديل"; Fsell.ID = Convert.ToInt16(dataGridView1.CurrentRow.Cells[0].Value); DataTable dt = new DataTable(); bunifuTransition1.ShowSync(Fsell); } else if (state == "BRO") { PL.FRM_BRO Fbro = new FRM_BRO(); Fbro.btnadd.ButtonText = "تعديل"; Fbro.ID = Convert.ToInt16(dataGridView1.CurrentRow.Cells[0].Value); DataTable dt = new DataTable(); bunifuTransition1.ShowSync(Fbro); } else if (state == "USER") { PL.FRM_ADDUSER Fuser = new FRM_ADDUSER(); Fuser.btnadd.ButtonText = "تعديل"; Fuser.ID = Convert.ToInt16(dataGridView1.CurrentRow.Cells[0].Value); DataTable dt = new DataTable(); bunifuTransition1.ShowSync(Fuser); } }