Esempio n. 1
0
 public void AddDept(deptModels dept)
 {
     try
     {
         string query = string.Format("" +
                                      "INSERT INTO mDept(IdDept,NamaDept)" +
                                      "VALUES('" + dept.IdDept + "'," +
                                      "'" + dept.NamaDept + "')");
         dbAccess.strConn = conn;
         dbAccess.ExecQuery(query);
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 2
0
        public bool AddAction(string Name, string Desc)
        {
            bool result = false;

            try
            {
                string Query = @"INSERT INTO tbl_action (Name, Description)
                                VALUES ('" + Name + "', '" + Desc + "')";
                dbAccess.strConn = conn;
                int res = dbAccess.ExecQuery(Query);
                if (res != -1)
                {
                    result = true;
                }
                else
                {
                    result = false;
                }
            }
            catch (Exception)
            {
                result = false;
                throw;
            }
            return(result);
        }