Beispiel #1
0
        public bool InsertEmployee(Employees emp)
        {
            string query = "Insert into Employees Values('" + emp.EmpId + "','" + emp.Name + "','" + emp.PhnNumber + "','" + emp.Salary + "','" + emp.Designation + "')";

            try
            {
                dcc.ConnectWithDB();
                int n = dcc.ExecuteSQL(query);
                dcc.CloseConnection();
                return(true);
            }
            catch (Exception exp)
            {
                return(false);
            }
        }
        public bool InsertUser(Login el)
        {
            string query = "Insert into Login values ('" + el.Id + "','" + el.Password + "')";

            try
            {
                dcc.ConnectWithDB();
                int n = dcc.ExecuteSQL(query);
                return(true);
            }
            catch (Exception exp)
            {
                return(false);
            }
            finally
            {
                dcc.CloseConnection();
            }
        }