Пример #1
0
 public frm_Add(int permissions, string table)
 {
     this.permissions = permissions;
     this.table       = table;
     dbh = new SQLDatabaseHandler();
     InitializeComponent();
 }
Пример #2
0
        public void CheckGetEmployeeServiceNotNull() //Julius
        {
            SQLDatabaseHandler     currentDatabaseInstance = SQLDatabaseHandler.Instance();
            List <EmployeeService> listToChek = currentDatabaseInstance.GetAllEmployeeService();

            Assert.IsNotNull(listToChek);
        }
Пример #3
0
        public void CheckGetEmployeeService()                                           //Julius
        {
            SQLDatabaseHandler currentDatabaseInstance = SQLDatabaseHandler.Instance(); //kan være en idatabase evt

            currentDatabaseInstance.GetAllEmployeeService();
            Assert.IsTrue(true);
        }
Пример #4
0
        //Custom contructor
        public frm_Edit(int permissions, string table, int id)
        {
            this.permissions = permissions;
            this.table       = table;
            this.id          = id;

            InitializeComponent();
            dbh = new SQLDatabaseHandler();
        }
Пример #5
0
        public frm_Add()
        {
            InitializeComponent();
            dbh    = new SQLDatabaseHandler();
            sqlCmd = new SqlCommand("Select top 1* from Tbl_Customer", dbh.GetCon());
            SqlDataReader sqlDR = sqlCmd.ExecuteReader();

            columns = new List <string>();
            for (int i = 1; i < sqlDR.FieldCount; i++)
            {
                columns.Add(sqlDR.GetName(i));
            }
            sqlDR.Close();
        }
Пример #6
0
 public frm_Add(int permissions)
 {
     this.permissions = permissions;
     dbh = new SQLDatabaseHandler();
     InitializeComponent();
 }
Пример #7
0
        public frm_Show(string query, int permissions, string department)
        {
            this.query       = query;
            this.permissions = permissions;
            this.department  = department;
            dbh = new SQLDatabaseHandler();
            InitializeComponent();

            #region IfAdmin
            if (permissions == 1)
            {
                btn_Add.Enabled    = true;
                btn_Edit.Enabled   = true;
                btn_Delete.Enabled = true;
            }
            #endregion
            #region IfSales
            if (permissions == 2)
            {
                if (department == "TBL_INVOICES")
                {
                    btn_Add.Enabled    = false;
                    btn_Edit.Enabled   = false;
                    btn_Delete.Enabled = false;
                }
                else
                {
                    btn_Add.Enabled    = true;
                    btn_Edit.Enabled   = true;
                    btn_Delete.Enabled = true;
                }
            }
            #endregion
            #region IfFinance
            if (permissions == 3)
            {
                if (department == "TBL_PROJECTS" || department == "TBL_APPOINTMENTS")
                {
                    btn_Add.Enabled    = false;
                    btn_Edit.Enabled   = false;
                    btn_Delete.Enabled = false;
                }
                else
                {
                    btn_Add.Enabled    = true;
                    btn_Edit.Enabled   = true;
                    btn_Delete.Enabled = true;
                }
            }
            #endregion
            #region IfDevelopment
            if (permissions == 4)
            {
                if (department == "TBL_CUSTOMERS" || department == "TBL_INVOICES" || department == "TBL_APPOINTMENTS")
                {
                    btn_Add.Enabled    = false;
                    btn_Edit.Enabled   = false;
                    btn_Delete.Enabled = false;
                }
                else
                {
                    btn_Add.Enabled    = false;
                    btn_Edit.Enabled   = true;
                    btn_Delete.Enabled = false;
                }
            }
            #endregion
        }
Пример #8
0
 public frm_Show()
 {
     InitializeComponent();
     dbh = new SQLDatabaseHandler();
 }
Пример #9
0
 public frm_Login(int permissions)
 {
     InitializeComponent();
     dbh = new SQLDatabaseHandler();
     this.permissions = permissions;
 }
Пример #10
0
        public void CheckSQLDatabaseHandler_GetInstance() //Julius
        {
            IDatabase currentDatabaseInstance = SQLDatabaseHandler.Instance();

            Assert.IsInstanceOfType(currentDatabaseInstance, typeof(IDatabase));
        }