Example #1
0
        public bool InsertAccount(Account acc)
        {
            string query = "INSERT into Accounts VALUES('" + acc.Billno + "','" + acc.Month + "', " + acc.Year + ", " + acc.Houserent + "," + acc.Emptotalsal + " ," + acc.Utilities + "," + acc.Totalamount + ")";

            try
            {
                dcc.ConnectWithDB();
                int n = dcc.ExecuteSQL(query);
                return(true);
            }
            catch (Exception exp)
            {
                Console.WriteLine(exp.StackTrace);
                return(false);
            }
            finally
            {
                dcc.CloseConnection();
            }
        }
Example #2
0
        public bool InsertOrder(Order ord)
        {
            string query = "INSERT into Orders VALUES('" + ord.Clientname + "','" + ord.Orderno + "', '" + ord.Ordertype + "', " + ord.Quantity + "," + ord.Cost + " ,'" + ord.Clientemail + "','" + ord.Clientnum + "')";

            try
            {
                dcc.ConnectWithDB();
                int n = dcc.ExecuteSQL(query);
                return(true);
            }
            catch (Exception exp)
            {
                Console.WriteLine(exp.StackTrace);
                return(false);
            }
            finally
            {
                dcc.CloseConnection();
            }
        }
Example #3
0
        public bool InsertUser(Login l)
        {
            string query = "INSERT into Login VALUES( '" + l.UserName + "', '" + l.Password + "', " + l.Role + ")";

            try
            {
                dcc.ConnectWithDB();
                int n = dcc.ExecuteSQL(query);
                return(true);
            }
            catch (Exception exp)
            {
                Console.WriteLine(exp.StackTrace);
                return(false);
            }
            finally
            {
                dcc.CloseConnection();
            }
        }
        public bool InsertEmployee(Employee emp)
        {
            string query = "INSERT into ManageEmployees VALUES('" + emp.EmpId + "', '" + emp.Name + "', '" + emp.PhnNumber + "','" + emp.Email + "', " + emp.Salary + ", '" + emp.Designation + "')";

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

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