Exemplo n.º 1
0
        public bool InsertProduct(ManageItems mi)
        {
            string query = "INSERT INTO ManageItems VALUES ('" + mi.ItemId + "','" + mi.ItemName + "','" + mi.ItemPrice + "')";

            try
            {
                dcc.ConnectWithDB();
                int n = dcc.ExecuteSQL(query);
                dcc.CloseConnection();
                return(true);
            }
            catch (Exception exp)
            {
                return(false);
            }
        }
        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);
            }
        }
Exemplo n.º 3
0
        public bool InsertUser(Login l)
        {
            string query = "INSERT into Login Values ('" + l.Id + "', '" + l.Password + "', " + l.Role + ")";

            try
            {
                dcc.ConnectWithDB();
                int n = dcc.ExecuteSQL(query);

                return(true);
            }
            catch (Exception exp)
            {
                return(false);
            }
            finally
            {
                dcc.CloseConnection();
            }
        }