private void button1_Click(object sender, EventArgs e) { if (textBox1.Text == "")//validation part { MessageBox.Show("Please, insert all values"); } else { if (Request_ID == -1) { MessageBox.Show("Please, Click a Request!"); } else { EmC.UpdateRequestStatues(Request_ID, "Accept"); EmC = new EmController(); BookID = EmC.CountBooks() + 1; int AuthorID = EmC.GetAuthorID(AuthorName, AuthorLname); if (AuthorID == 0) { AuthorID = EmC.CountAuther() + 1; int x = EmC.AddAuthor(AuthorID, AuthorName, AuthorLname); } int r = EmC.InsertBook(BookID, BookName, Book_langauge, BookGenre, Book_price, Convert.ToInt32(textBox1.Text), BookDesc, 0, AuthorID, Publisher_ID); DataTable dt = EmC.ViewAllRequests(); dataGridView1.DataSource = dt; dataGridView1.Refresh(); Request_ID = -1; } } }
private void ViewRequests_Load(object sender, EventArgs e) { EmC = new EmController(); DataTable dt = EmC.ViewAllRequests(); dataGridView1.DataSource = dt; dataGridView1.Refresh(); }
private void PurchHistoryForm_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'bookstoreDataSet3.Sales_History' table. You can move, or remove it, as needed. EmC = new EmController(); DataTable dt = EmC.ViewAllPurchaseHistory(); dataGridView1.DataSource = dt; dataGridView1.Refresh(); }
public Empolyee(string Email, string eid, string ename, string UserType) { InitializeComponent(); Em = new EmController(); type = UserType; mail = Email; id = eid; name = ename; branchID = Em.GetBranchIDfromEmpTable(Convert.ToInt32(id)).ToString(); label1.Text = "#" + id; label2.Text = UserType; if (UserType == "Employee") { btnEmployees.Visible = false; btnViewRequests.Visible = false; btnBranches.Visible = false; btnReports.Visible = false; } else if (UserType == "Manager") { btnReports.Visible = false; btnViewRequests.Visible = false; btnBranches.Visible = false; label2.Left = 59; } else { label2.Left = 66; } BooksToBuy = new List <int>(); Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, Width, Height, 25, 25)); PnlNav.Height = btnMainMenu.Height; PnlNav.Top = btnMainMenu.Top; PnlNav.Left = btnMainMenu.Left; //btnMainMenu.BackColor = Color.FromArgb(46, 51, 73); IbITitle.Text = "Main Menu"; this.PnlFormLoader.Controls.Clear(); MainMenuForm MainForm = new MainMenuForm(id, mail, name) { Dock = DockStyle.Fill, TopLevel = false, TopMost = true }; MainForm.FormBorderStyle = FormBorderStyle.None; this.PnlFormLoader.Controls.Add(MainForm); MainForm.Show(); }
public AddEmployee(int EBranchID, int EManagerID, string type) { InitializeComponent(); EmC = new EmController(); id = EmC.CountEmployees() + 1; BranchID = EBranchID; ManagerID = EManagerID; UserType = type; if (UserType == "Manager") { label9.Visible = false; comboBox2.Visible = false; } }
private void button2_Click(object sender, EventArgs e) { if (Request_ID == -1) { MessageBox.Show("Please, Click a Request!"); } else { EmC.UpdateRequestStatues(Request_ID, "Reject"); EmC = new EmController(); DataTable dt = EmC.ViewAllRequests(); dataGridView1.DataSource = dt; dataGridView1.Refresh(); Request_ID = -1; } }
public AddBook() { InitializeComponent(); EmC = new EmController(); id = EmC.CountBooks() + 1; }
public AddBranch() { InitializeComponent(); EmC = new EmController(); id = EmC.CountBranches() + 1; }
public AddPurch(List <int> CartPtr) { InitializeComponent(); CartPointer = CartPtr.ToArray(); ControlObj = new EmController(); }
public SearchBooks(List <int> CartPtr) { InitializeComponent(); CartPointer = CartPtr; ControlObj = new EmController(); }
public EditBook() { EmC = new EmController(); InitializeComponent(); }
public EditBranch() { InitializeComponent(); EmC = new EmController(); }
public AddAuthor() { InitializeComponent(); EmC = new EmController(); id = EmC.CountAuther(); }
public Setting(string Mail) { InitializeComponent(); Email = Mail; ControlObj = new EmController(); }
public EditEmployee() { InitializeComponent(); EmC = new EmController(); }