コード例 #1
0
 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;
         }
     }
 }
コード例 #2
0
        private void ViewRequests_Load(object sender, EventArgs e)
        {
            EmC = new EmController();
            DataTable dt = EmC.ViewAllRequests();

            dataGridView1.DataSource = dt;
            dataGridView1.Refresh();
        }
コード例 #3
0
        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();
        }
コード例 #4
0
        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();
        }
コード例 #5
0
        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;
            }
        }
コード例 #6
0
 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;
     }
 }
コード例 #7
0
 public AddBook()
 {
     InitializeComponent();
     EmC = new EmController();
     id  = EmC.CountBooks() + 1;
 }
コード例 #8
0
 public AddBranch()
 {
     InitializeComponent();
     EmC = new EmController();
     id  = EmC.CountBranches() + 1;
 }
コード例 #9
0
 public AddPurch(List <int> CartPtr)
 {
     InitializeComponent();
     CartPointer = CartPtr.ToArray();
     ControlObj  = new EmController();
 }
コード例 #10
0
 public SearchBooks(List <int> CartPtr)
 {
     InitializeComponent();
     CartPointer = CartPtr;
     ControlObj  = new EmController();
 }
コード例 #11
0
 public EditBook()
 {
     EmC = new EmController();
     InitializeComponent();
 }
コード例 #12
0
 public EditBranch()
 {
     InitializeComponent();
     EmC = new EmController();
 }
コード例 #13
0
 public AddAuthor()
 {
     InitializeComponent();
     EmC = new EmController();
     id  = EmC.CountAuther();
 }
コード例 #14
0
 public Setting(string Mail)
 {
     InitializeComponent();
     Email      = Mail;
     ControlObj = new EmController();
 }
コード例 #15
0
 public EditEmployee()
 {
     InitializeComponent();
     EmC = new EmController();
 }